You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Caroline Jen <ji...@yahoo.com> on 2003/07/06 02:21:00 UTC

My LoginView.jsp Displays A Blank Page

My LogonView.jsp displays a blank page.  I have no
idea why nothing is written while the
MessageResources.properties file is found.
 
I would have gotton HTTP Status 500 if the
MessageResources.properties is not found or the value
of the corresponding key in the bean:message tag
cannot be picked up.  I did not get any error message.
 I cannot figure out the reason.  Please help.

Here is my web.xml file:
[CODE]
&lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;

&lt;!DOCTYPE web-app
  PUBLIC "-//Sun Microsystems, Inc.//DTD Web
Application 2.2//EN"
  "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd"&gt;

&lt;web-app&gt;
  &lt;display-name&gt;Struts Blank
Application&lt;/display-name&gt;
  
  &lt;!-- Standard Action Servlet Configuration (with
debugging) --&gt;
  &lt;servlet&gt;
    &lt;servlet-name&gt;action&lt;/servlet-name&gt;
   
&lt;servlet-class&gt;org.apache.struts.action.ActionServlet&lt;/servlet-class&gt;
    &lt;init-param&gt;
      &lt;param-name&gt;application&lt;/param-name&gt;
     
&lt;param-value&gt;resources.version1.MessageResources&lt;/param-value&gt;
    &lt;/init-param&gt;
    &lt;init-param&gt;
      &lt;param-name&gt;mapping&lt;/param-name&gt;
     
&lt;param-value&gt;org.apache.struts.action.RequestActionMapping&lt;/param-value&gt;
    &lt;/init-param&gt;
    &lt;init-param&gt;
      &lt;param-name&gt;config&lt;/param-name&gt;
     
&lt;param-value&gt;/WEB-INF/struts-config.xml&lt;/param-value&gt;
    &lt;/init-param&gt;
    &lt;init-param&gt;
      &lt;param-name&gt;debug&lt;/param-name&gt;
      &lt;param-value&gt;2&lt;/param-value&gt;
    &lt;/init-param&gt;
    &lt;init-param&gt;
      &lt;param-name&gt;detail&lt;/param-name&gt;
      &lt;param-value&gt;2&lt;/param-value&gt;
    &lt;/init-param&gt;
    &lt;load-on-startup&gt;2&lt;/load-on-startup&gt;
  &lt;/servlet&gt;


  &lt;!-- Standard Action Servlet Mapping --&gt;
  &lt;servlet-mapping&gt;
    &lt;servlet-name&gt;action&lt;/servlet-name&gt;
    &lt;url-pattern&gt;*.do&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;


  &lt;!-- The Usual Welcome File List --&gt;
  &lt;welcome-file-list&gt;
    &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt;
  &lt;/welcome-file-list&gt;


  &lt;!-- Struts Tag Library Descriptors --&gt;
  &lt;taglib&gt;
   
&lt;taglib-uri&gt;/WEB-INF/struts-bean.tld&lt;/taglib-uri&gt;
   
&lt;taglib-location&gt;/WEB-INF/struts-bean.tld&lt;/taglib-location&gt;
  &lt;/taglib&gt;

  &lt;taglib&gt;
   
&lt;taglib-uri&gt;/WEB-INF/struts-html.tld&lt;/taglib-uri&gt;
   
&lt;taglib-location&gt;/WEB-INF/struts-html.tld&lt;/taglib-location&gt;
  &lt;/taglib&gt;

  &lt;taglib&gt;
   
&lt;taglib-uri&gt;/WEB-INF/struts-logic.tld&lt;/taglib-uri&gt;
   
&lt;taglib-location&gt;/WEB-INF/struts-logic.tld&lt;/taglib-location&gt;
  &lt;/taglib&gt;

  &lt;taglib&gt;
   
&lt;taglib-uri&gt;/WEB-INF/struts-nested.tld&lt;/taglib-uri&gt;
   
&lt;taglib-location&gt;/WEB-INF/struts-nested.tld&lt;/taglib-location&gt;
  &lt;/taglib&gt;

  &lt;taglib&gt;
   
&lt;taglib-uri&gt;/WEB-INF/struts-tiles.tld&lt;/taglib-uri&gt;
   
&lt;taglib-location&gt;/WEB-INF/struts-tiles.tld&lt;/taglib-location&gt;
  &lt;/taglib&gt;

  &lt;taglib&gt;
   
&lt;taglib-uri&gt;/WEB-INF/struts-template.tld&lt;/taglib-uri&gt;
   
&lt;taglib-location&gt;/WEB-INF/struts-template.tld&lt;/taglib-location&gt;
  &lt;/taglib&gt;

&lt;/web-app&gt;
[/CODE]

Here is my MessageResources.properties file:
[CODE]
button.submit=Send for Verification
button.reset=Clear the Form
logonForm.userId=User Name
logonForm.password=Password
logonForm.confirm_password=Confirm Password
logonForm.emailAddress=E-mail Address
logonForm.hear_from_us=How did you hear about the
StudentScholar.org?
logonForm.subscriber=Subscribe to the
StudentScholar.org newsletter
logonForm.send_updates=Occassionally send me updates
logonForm.fname=First Name
logonForm.lname=Last name
logonForm.streetAddress=Street Address
logonForm.city=City
logonForm.state=State
logonForm.zip=Zip Code
logonForm.country=Country
logonForm.phone=Telephone
logonForm.degree_type=Degree Type(s)
logonForm.major=Majoring Field(s)
logonForm.cumulativeGPA=Cumulative GPA
logonForm.collegeID=College ID
logonForm.permissionID=Permission ID
logonForm.last_logon_date=Last Logon Date
heading.logon=&lt;H2&gt;Enter your user
information&lt;/H2&gt;
title.logon=Logon Screen
error.invalid.logon=&lt;li&gt;The User ID and/or
Password are invalid. Please try again.&lt;/li&gt;
errors.header=&lt;h3&gt;&lt;font
color="red"&gt;Validation
Error&lt;/font&gt;&lt;/h3&gt;You must correct the
following error(s) before proceeding:&lt;ul&gt;
title.mainmenu=Welcome
heading.mainmenu=&lt;H1&gt;Welcome!&lt;/H1&gt;
label.userType=&lt;H2&gt;You are authorized to use
this system as a&lt;/H2&gt;
errors.prefix=&lt;LI&gt;
errors.suffix=&lt;/LI&gt;
errors.footer=&lt;/UL&gt;&lt;hr&gt;
errors.minlength={0} can not be less than {1}
characters.
errors.required={0} is required.
errors.date={0} is not a date.
errors.double={0} must be an double.
errors.email={0} is an invalid e-mail address.

[/CODE]

Here is my LogonView.jsp:
[CODE]
&lt;!-- LogonView.jsp --&gt;

&lt;%@ taglib uri="/WEB-INF/struts-html.tld"
prefix="html" %&gt;
&lt;%@ taglib uri="/WEB-INF/struts-bean.tld"
prefix="bean" %&gt;

&lt;html&gt;
&lt;head&gt;&lt;title&gt;&lt;bean:message
key="title.logon" /&gt;&lt;/title&gt;
&lt;html:javascript formName="logon" /&gt;
&lt;/head&gt;
&lt;body bgcolor="white"&gt;
&lt;bean:message key="heading.logon" /&gt;
&lt;html:errors /&gt;
&lt;html:form action="/logon" onsubmit="return
validateLogon(this)" &gt;
&lt;table border="0" width="100%"&gt;
    &lt;tr&gt;
        &lt;th aligh="right"&gt;
           &lt;bean:message key="logonForm.userId"
/&gt;:
        &lt;/th&gt;
        &lt;td align="left"&gt;
	   &lt;html:text property="userId" size="10" /&gt;
	&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;th aligh="right"&gt;
           &lt;bean:message key="logonForm.password"
/&gt;:
        &lt;/th&gt;
        &lt;td align="left"&gt;
	   &lt;html   :p   assword property="password"
size="10" /&gt;
	&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;th aligh="right"&gt;
           &lt;bean:message
key="logonForm.confirm_password" /&gt;:
        &lt;/th&gt;
        &lt;td align="left"&gt;
	   &lt;html   :p   assword
property="confirm_password" size="10" /&gt;
	&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;th aligh="right"&gt;
	   &lt;bean:message key="logonForm.emailAddress"
/&gt;:
        &lt;/th&gt;
        &lt;td align="left"&gt;
	   &lt;html:text property="emailAddress" size="25"
/&gt;
	&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;th aligh="right"&gt;
	   &lt;bean:message key="logonForm.hear_about_us"
/&gt;:
        &lt;/th&gt;
        &lt;td align="left"&gt;
           &lt;html:text property="hear_about_us"
size="25" /&gt;
	&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;th aligh="right"&gt;
           &lt;bean:message key="logonForm.subscriber"
/&gt;:
        &lt;/th&gt;
        &lt;td align="left"&gt;
           &lt;html:checkbox property="subscriber"
/&gt;
	&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;th aligh="right"&gt;
	   &lt;bean:message key="logonForm.send_updates"
/&gt;:
        &lt;/th&gt;
        &lt;td align="left"&gt;
           &lt;html:checkbox property="send_updates"
/&gt;
	&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;th aligh="right"&gt;
           &lt;bean:message key="logonForm.fname"
/&gt;:
        &lt;/th&gt;
        &lt;td align="left"&gt;
	   &lt;html:text property="fname" size="15" /&gt;
	&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;th aligh="right"&gt;
	   &lt;bean:message key="logonForm.lname" /&gt;:
        &lt;/th&gt;
        &lt;td align="left"&gt;
	   &lt;html:text property="lname" size="15" /&gt;
	&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;th aligh="right"&gt;
	   &lt;bean:message key="logonForm.streetAddress"
/&gt;:
        &lt;/th&gt;
        &lt;td align="left"&gt;
	   &lt;html:text property="streetAddress" size="50"
/&gt;
	&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;th aligh="right"&gt;
	   &lt;bean:message key="logonForm.city" /&gt;:
        &lt;/th&gt;
        &lt;td align="left"&gt;
	   &lt;html:text property="city" size="15" /&gt;
	&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;th aligh="right"&gt;
	   &lt;bean:message key="logonForm.state" /&gt;:
        &lt;/th&gt;
        &lt;td align="left"&gt;
           &lt;html:text property="state" size="25"
/&gt;
	&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;th aligh="right"&gt;
	   &lt;bean:message key="logonForm.zip" /&gt;:
        &lt;/th&gt;
        &lt;td align="left"&gt;
	   &lt;html:text property="zip" size="10" /&gt;
	&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;th aligh="right"&gt;
	   &lt;bean:message key="logonForm.country" /&gt;:
        &lt;/th&gt;
        &lt;td align="left"&gt;
	   &lt;html:text property="country" size="25" /&gt;
	&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;th aligh="right"&gt;
	   &lt;bean:message key="logonForm.phone" /&gt;:
        &lt;/th&gt;
        &lt;td align="left"&gt;
	   &lt;html:text property="phone" size="15" /&gt;
	&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;th aligh="right"&gt;
	   &lt;bean:message key="logonForm.degree_type"
/&gt;:
        &lt;/th&gt;
        &lt;td align="left"&gt;
	   &lt;html:textarea property="degree_type" rows="9"
cols="90" /&gt;
	&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;th aligh="right"&gt;
	   &lt;bean:message key="logonForm.major" /&gt;:
        &lt;/th&gt;
        &lt;td align="left"&gt;
	   &lt;html:text property="major" size="15" /&gt;
	&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;th aligh="right"&gt;
	   &lt;bean:message key="logonForm.cumulativeGPA"
/&gt;:
        &lt;/th&gt;
        &lt;td align="left"&gt;
	   &lt;html:text property="cumulativeGPA" size="4"
/&gt;
	&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;th aligh="right"&gt;
	   &lt;bean:message key="logonForm.collegeID" /&gt;:
        &lt;/th&gt;
        &lt;td align="left"&gt;
	   &lt;html:text property="collegeID" size="5" /&gt;
	&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;th aligh="right"&gt;
	   &lt;bean:message key="logonForm.permissionID"
/&gt;:
        &lt;/th&gt;
        &lt;td align="left"&gt;
	   &lt;html:text property="permissionID" size="5"
/&gt;
	&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;th aligh="right"&gt;
	   &lt;bean:message key="logonForm.last_logon_date"
/&gt;:
        &lt;/th&gt;
        &lt;td align="left"&gt;
	   &lt;html:text property="last_logon_date" size="15"
/&gt;
	&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td align="right"&gt;
            &lt;html:submit&gt;
                &lt;bean:message key="button.submit"
/&gt;
            &lt;/html:submit&gt;
        &lt;/td&gt;
        &lt;td align="right"&gt;
            &lt;html:reset&gt;
                &lt;bean:message key="button.reset"
/&gt;
            &lt;/html:reset&gt;
        &lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;
&lt;/html:form&gt;
&lt;/body&gt;
&lt;/html&gt;
[/CODE]



__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org