...

View Full Version : jsp forward question



bores
03-20-2012, 11:20 PM
Hi

I want to forward the post request of my form to the servlet LoginServlet exactly as if I make action="LoginServlet" in my form. My form is in LoginForm.jsp and this is my approach :

Content of LoginForm.jsp


<%
if (request.getMethod().equals("POST"))
{
// ... Some checks
<jsp:forward page="/LoginServlet"/>
}
%>
<form action="LoginForm.jsp">
<input type="text" name="username">
<input type="password" name="userpass">
<input type="submit" value="submit">
</form>


So I don't know about the slash in the <jsp:forward page="/LoginServlet"/> if it is mandatory or useless. After that, the LoginServlet servlet should be able to capture the post data with doPost and doGet procedures.

Regards

ckeyrouz
03-21-2012, 09:07 PM
If it is a servlet it should be configured in your web.xml file.

Check how the path is configured in the web.xml and type it here.

kashif1
03-22-2012, 04:34 AM
Hi friends,
I know that the jsp is used to develop the website in the java language. I know that the main aim of the jsp is to provide the security in your website. I know that session is the main key tools of the JSP page.
JSP forword is used in website to forword the request into the server. Servlet is also used in this java programming .
Thanks .



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum