aspose file tools*
The moose likes Struts and the fly likes HTTP Status 500 - When Tried The First Login Example Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "HTTP Status 500 - When Tried The First Login Example" Watch "HTTP Status 500 - When Tried The First Login Example" New topic
Author

HTTP Status 500 - When Tried The First Login Example

JiaPei Jen
Ranch Hand

Joined: Nov 19, 2000
Posts: 1309
Hi, I began to learn the Struts yesterday. I followed the step by step instructions at
http://www.javaranch.com/newsletter/Mar2002/newslettermar2002.jsp#struts
I am very embarrassed to say that I failed to run the first "Login" example. Java source codes are provided, and all I have to do is to compile them and put class files, xml files, JSP files in the right directories. I got HTTP status 500 (the error messages are shown below). I noticed that the error message says:
"Missing message for key title.login"
I checked the MessageResources.properties file in the c:/tomcal installation directory/webapps/struts/WEB-INF/classes/test/struts
and it looks to me that title.login is there.
I am unable to find the problem and please help.
This is the content of the MessageResources.properties file:

This is what I got after I entered
http://localhost:8080/struts/jsp/LoginView.jsp
in my browser:
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
Is the MessageResources file properly set up in the web.xml file?


Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
JiaPei Jen
Ranch Hand

Joined: Nov 19, 2000
Posts: 1309
I tried two ways of saving the contents of MessageResources.properties
1. in the text field of Save As, I typed:
"MessageResources.properties"
2. in the text field of Save As, I typed:
"MessageResources.properties.txt"
nonetheless, I got the same error message: HTTP Status 500
The web.xml file is located in the c:\tomcat installation directiory\webapps\struts\WEB-INF directory. This is the contents of the web.xml file:
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
The file has to be named: MessageResources.properties and it has to be located in the test/struts directory.
If everything seems to be where it is then try removing the title.login from Login.jsp and running again. If it now tells "Missing Message" for the next tag (which I suspect it will) then the problem is that it isn't finding your MessageResources.properties file.
JiaPei Jen
Ranch Hand

Joined: Nov 19, 2000
Posts: 1309
The MessageResources.properties is located in the c:\tomcat installation directory\webapps\struts\WEB-INF\classes\test\struts directory.
Sorry, I do not fully understand your suggestion. I see this statement:
<HEAD><TITLE><struts:message key="title.login" /></TITLE></HEAD>
in the LoginView.jsp file. What does the statement look like if you want me to remove title.login?
[ February 22, 2003: Message edited by: JiaPei Jen ]
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
<HEAD><TITLE>Login Screen</TITLE></HEAD>
JiaPei Jen
Ranch Hand

Joined: Nov 19, 2000
Posts: 1309
After I deleted title.login and re-ran the example, I got this HTTP Status 500:

You are right, the MessageResources.properties file cannot be found. Nonetheless, that file "is in the right directory".
I think the problem may be that the MessageResources.properties was not saved with the right extension. I can download that file again, but .......... I feel very embarrassed to say that I must learn how to save MessageResources.properties in the test.struts directory.
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
Try going to the directory and renaming the file correctly if it has the wrong extension.
Remember that any time you change the MessageResources file you need to restart Tomcat.
JiaPei Jen
Ranch Hand

Joined: Nov 19, 2000
Posts: 1309
I have tried to save the MessageResources.properties file several times. Each time, I shut down and re-start the Tomcat to run the Login example.
I simply get HTTP Status 500. The MessageResources.properties simply cannot be found.
I do not know what to do. Now, it seems to be difficult. I know the problem but cannot correct the problem.
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
Everything looks OK. The only things I can think of is that the file is not correctly named or the contents of the file are wrong.
JiaPei Jen
Ranch Hand

Joined: Nov 19, 2000
Posts: 1309
I looked at the name of the file again and again, it is
MessageResources.properties
And I copy and paste the contents of that file below:

I really do not know what to do.
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
See this thread:
http://www.coderanch.com/t/46371/Struts/struts-installation
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HTTP Status 500 - When Tried The First Login Example
 
Similar Threads
Error in JSP
jasperException: oracle.jdbc.driver. OracleDriver
DynaActionForm - Exception creating bean
isOutdated Compiler?
Error while trying NewsLetter Example