aspose file tools*
The moose likes JSP and the fly likes jsp file not found, when calling another jsp file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "jsp file not found, when calling another jsp file" Watch "jsp file not found, when calling another jsp file" New topic
Author

jsp file not found, when calling another jsp file

northfield Sid
Ranch Hand

Joined: Aug 08, 2002
Posts: 106
I have a jsp called login, the file is written out below.
<HTML><HEAD><TITLE>JSP Checks Login Information Against Parameters</TITLE></HEAD><BODY>
<H2> Login </H2>
<FORM ACTION=/loginCheck METHOD=POST>
Username : <INPUT TYPE=TEXT NAME=usernameFormParameter><BR>
Password : <INPUT TYPE=TEXT NAME=passwordFormParameter><BR>
<INPUT TYPE=SUBMIT VALUE=Login>
</FORM>
</BODY></HTML>
The above file calls another file called called loginCheck.jsp. I have written out the jsp below:
<HTML><HEAD><TITLE>JSP Checks Login Information Against Parameters</TITLE></HEAD><BODY>
<H1>Hello</H1>
<%
String usernameFormParameterValue = request.getParameter("usernameFormParameter");
String passwordFormParameterValue = request.getParameter("passwordFormParameter");
if(usernameFormParameterValue!=null){
String usernameInitParameterValue = config.getInitParameter("username");
String passwordInitParameterValue = config.getInitParameter("password");
if(usernameFormParameterValue.equals(usernameInitParameterValue)&&passwordFormParameterValue.equals(passwordInitParameterValue)){
// login correct, greetings %>
Welcome !!!
<%
} else {
// login incorrect, please try again %>
Sorry but we dont know you <BR>
Would you like to <A HREF=login.jsp>try again</A>
<% }
} else {
// login incorrect, please try again %>
Sorry but your login is incorrect <BR>
Would you like to <A HREF=login.jsp>try again</A>
<% }
%>
</BODY></HTML>
Both files are at this location:
D:\tomcat\jakarta-tomcat-3.3.1\webapps\myJSPs\jsp\Hour13
I enter the url in the browser address box:
http://localhost:8080/myJSPs/jsp/Hour13/login.jsp
I then enter Username: northfield
Password: 12345
and press <login> button
After pressing the login button a new page is shown in the browser and in the browser address box a url:
http://localhost:8080/loginCheck
The error message that is given is:
The page cannot be found
The page you are looking for might have been removed, had its name changed, or is temporarily unavailable.
--------------------------------------------------------------------------------
Please try the following:
If you typed the page address in the Address bar, make sure that it is spelled correctly.
Open the localhost:8080 home page, and then look for links to the information you want.
Click the Back button to try another link.
Click Search to look for information on the Internet.
HTTP 404 - File not found
Internet Explorer
Pat Wallwork
Ranch Hand

Joined: Sep 23, 2001
Posts: 72
Hi,
In the code you posted above you've put action=/loginCheck
It should read action=/loginCheck.jsp
-Pat
 
 
subject: jsp file not found, when calling another jsp file