on 01-20-2006 7:01 PM
I've created a simple jsp containing a form with two text fields as follows:
<%@ page language="java" %>
<html>
<body>
<form action="formtest" name="test_form" method="post">
<input type="text" name"field1"/><br>
<input type="text" name"field2"/><br>
<input type="Submit" value="Submit"/>
</form>
</body>
</html>
I pass the request to a servlet, and in the doPost() method I try to print out the two parameters. However, the request doesn't seem to contain any information. I printed the parameter names and the attribute names and the only thing I get is one attribute name "com.sap.servlet.separator.zone".
Any ideas as to why the information is not being passed to the servlet?
Is the name of your servlet formtest? Are you sure the action on your form is correct?
Take a look at this link:
<a href="http://www.apl.jhu.edu/hall/java/Servlet-Tutorial/Servlet-Tutorial-Form-Data.html">http://www.apl.jhu.edu/hall/java/Servlet-Tutorial/Servlet-Tutorial-Form-Data.html</a>
regards,
Dion
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have traced the problem to another servlet. I'm using NTLM authentication to retreive the Users NT login. The code is a slightly modified version of the following <a href="http://www.rgagnon.com/javadetails/java-0441.html">http://www.rgagnon.com/javadetails/java-0441.html</a>
I find that once this code runs it disables my ability to call the doPost() method from a form.
Any ideas as to how I can fix this?
Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mat Zitnik,
<b>Solution:</b>
I think you have not specified the correct formtest.java in your source code.
For more information see this link...
This link gives how to specify packageless & packaged servlets in your code ...
http://courses.coreservlets.com/Course-Materials/pdf/struts/Servlet+JSP-Review.pdf
Path information
or
Mapping servlet with the url in web.xml...
Refer this site....
Sample XML.
http://www.adp-gmbh.ch/java/web_application/web_xml.html
Web.xml Elements.
http://e-docs.bea.com/wls/docs81/webapp/web_xml.html
Servlet Mapping & More.
<b>Alternate Solution:</b>
JSP has specific tags to call a servlet from jsp.
Use <jsp:forward.../> & <jsp:include.../>
For More information refer this link...
http://www.javaskyline.com/learnjsp.html
(Search for "Using JSP with Servlets" in this page).
Hope it helps.
Reward Points for useful answers.
Regards,
Maheswaran.B
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hello mat,
is your servlet mapped in your web descriptor?
much better if you could post your web descriptor
and your doPost method code.
regards
jo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.