Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calling Servlet from a Form 1

Status
Not open for further replies.

mcdonals

Programmer
Jun 21, 2001
4
US
Does anyone know how to call a servlet in JDeveloper from an html form? When I right click a servlet and choose run my browser displays the url as http:localhost:7070/"package name"/_servlet_ or something to that effect. The trouble is how do you call a specific servlet? I'd like to be able to call my servlets using the action method on an html form. Most webservers find servlets by name"."servlet name" unfortunately this doesn't work in JDev, and nothing I've tried does. Any ideas?

Thanks,
Scott
 
Very good question, I have to call a servlet from a form.
It doesn't work! Have tou managed to call it?
 
I still haven't figured out how to distinguish one servlet from another, but if you only need to call 1 servlet from your form you are in luck because the following works.

<form action=&quot;_servlet&quot;>

Pretty dumb I know, but this is apparently what JDeveloper calls every servlet, regardless of its class name. You'll see it when you right click on your individual servlets and click run. So does anyone know yet how to call a specific servlet? That still eludes me.
 
Jun 29, 2001 [2]
hi, I use NT, and I installed oracle8.1.6 with Jdeveloper3.1.6. I create a HTML page with a form
<FORM ACTION='test_servlet' METHOD=POST>
<INPUT TYPE=TEXT NAME='nom'> <INPUT TYPE='SUBMIT' VALUE='OK'> </FORM>
i created and compile a servlet, it doesn't work. I see the url with Iexplorer5: but the test_servlet.class is in the directory!
I use also servletrunner in ORACLE_HOME/apache/jsdk/bin
(ps: the example suplied with oracle (oracle_home/apache/jsdk/examples/jdcsurvey) don't work!)
servletrunner -p 8080 -d d:/oracle/ora81/apache/apache/htdocs/web-inf
(the servlet.properties is in the same directory)

I put jsdk.jar in the PATH and classPATH.
I create servlet.properties to define a name corresponding to the servlet.
the problem persists
Could you help me?
 
The following information is from Jdeveloper Help:

&quot;Registering a Servlet Using the Web Object Manager
You can use the Web Object Manager to register a servlet.
This allows you to call it from JSP pages and access it
from the Servlet Launcher.

To register a servlet:
Choose Wizards | Web Object Manager.
Select the Servlets folder.
Click the Register button .
Enter the virtual path for your servlet.
Later, when you access your servlet, you must prepend
Project_Name_html to this virtual path. For example,
if you enter MyServlet here, your servlet will be
accessible at Project_Name_html/MyServlet.
Click Browse. In the Package and Class Browser,
select the class that implements your servlet.
Click OK to close the browser.
Click OK to close the dialog and register the servlet.&quot;.
After I registered the servlet I was able to call it with:

<FORM ACTION= METHOD=GET>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top