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:29:20 UTC

My LogonView.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:
-------------------------------------------------------
<?xml version="1.0" encoding="ISO-8859-1"?>

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

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


  <!-- Standard Action Servlet Mapping -->
  <servlet-mapping>
    <servlet-name>action</servlet-name>
    <url-pattern>*.do</url-pattern>
  </servlet-mapping>


  <!-- The Usual Welcome File List -->
  <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
  </welcome-file-list>


  <!-- Struts Tag Library Descriptors -->
  <taglib>
    <taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri>
   
<taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
  </taglib>

  <taglib>
    <taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
   
<taglib-location>/WEB-INF/struts-html.tld</taglib-location>
  </taglib>

  <taglib>
    <taglib-uri>/WEB-INF/struts-logic.tld</taglib-uri>
   
<taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
  </taglib>

  <taglib>
   
<taglib-uri>/WEB-INF/struts-nested.tld</taglib-uri>
   
<taglib-location>/WEB-INF/struts-nested.tld</taglib-location>
  </taglib>

  <taglib>
    <taglib-uri>/WEB-INF/struts-tiles.tld</taglib-uri>
   
<taglib-location>/WEB-INF/struts-tiles.tld</taglib-location>
  </taglib>

  <taglib>
   
<taglib-uri>/WEB-INF/struts-template.tld</taglib-uri>
   
<taglib-location>/WEB-INF/struts-template.tld</taglib-location>
  </taglib>

</web-app>

-------------------------------------------------------

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=<H2>Enter your user information</H2>
title.logon=Logon Screen
error.invalid.logon=<li>The User ID and/or Password
are invalid. Please try again.</li>
errors.header=<h3><font color="red">Validation
Error</font></h3>You must correct the following
error(s) before proceeding:<ul>
title.mainmenu=Welcome
heading.mainmenu=<H1>Welcome!</H1>
label.userType=<H2>You are authorized to use this
system as a</H2>
errors.prefix=<LI>
errors.suffix=</LI>
errors.footer=</UL><hr>
errors.invalid={0} is invalid.
errors.maxlength={0} can not be greater than {1}
characters.
errors.minlength={0} can not be less than {1}
characters.
errors.range={0} is not in the range {1} through {2}.
errors.required={0} is required.
errors.byte={0} must be an byte.
errors.date={0} is not a date.
errors.double={0} must be an double.
errors.float={0} must be an float.
errors.integer={0} must be an integer.
errors.long={0} must be an long.
errors.short={0} must be an short.
errors.creditcard={0} is not a valid credit card
number.
errors.email={0} is an invalid e-mail address.
errors.cancel=Operation cancelled.
errors.detail={0}
errors.general=The process did not complete. Details
should follow.
errors.token=Request could not be completed. Operation
is not in sequence.
welcome.title=Struts Blank Application
welcome.heading=Welcome!
welcome.message=To get started on your own
application, copy the struts-blank.war to a new WAR
file using the name for your application. Place it in
your container's "webapp" folder (or equivalent), and
let your container auto-deploy the application. Edit
the skeleton configuration files as needed, restart
your container, and you are on your way! (You can find
the application.properties file with this message in
the /WEB-INF/src/java/resources folder.)

-------------------------------------------------------

Here is my LogonView.jsp:


code:
-------------------------------------------------------
<!-- LogonView.jsp -->

<%@ taglib uri="/WEB-INF/struts-html.tld"
prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld"
prefix="bean" %>

<html>
<head><title><bean:message key="title.logon"
/></title>
<html:javascript formName="logon" />
</head>
<body bgcolor="white">
<bean:message key="heading.logon" />
<html:errors />
<html:form action="/logon" onsubmit="return
validateLogon(this)" >

           <bean:message key="logonForm.userId" />:
	   <html:text property="userId" size="10" />

           <bean:message key="logonForm.password" />:
	   <html:password property="password" size="10" />

            <html:submit>
                <bean:message key="button.submit" />
            </html:submit>

            <html:reset>
                <bean:message key="button.reset" />
            </html:reset>

</html:form>
</body>
</html>
-------------------------------------------------------


__________________________________
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


Re: Help on installing struts-el

Posted by "David M. Karr" <dm...@earthlink.net>.
>>>>> "Richard" == Richard Mixon <rn...@custco.biz> writes:

    Richard> Where can I find instructions on how to use the struts-el version of struts
    Richard> instead of the standard struts "lib" files? The README does not cover this
    Richard> and that seems to be all there is in the way of doc.

    Richard> I'm laboring under the assumption that struts-el is a super-set of struts. I
    Richard> should be able to move my existing application over and have it use the
    Richard> "struts-el" jar files. I can then selectively change from, for example an
    Richard> "<html:text" tag to an "<html-el:text" tag assuming I've setup the TLD's
    Richard> correctly for my taglibs.

    Richard> I had a document that explained it well - but tossed it the other day,
    Richard> thinking I was not going to need it for a while. Guess what, I need it now
    Richard> <:-). I remember that it said you needed to first use the standard struts
    Richard> "lib" files and then selectively replace them with the files in the
    Richard> "contrib" lib directory. I've been Googling for hours and searching the
    Richard> archive - cannot find anything substantiative.

    Richard> I tried just using the contrib/struts-el/lib directory files, but end up
    Richard> getting errors from the validation javascripts issued by my
    Richard> "<html:javascript" tags (cannot find the "required" validation).

You need both the Struts-EL and Struts jars.  If you look in the "struts-el"
distribution, you'll see a "strutsel-exercise-taglib" application.  You can
inspect that application to see the jars that you'll need.  If you're getting
errors from the validation javascripts, I'm not sure what is happening there.

-- 
===================================================================
David M. Karr          ; Java/J2EE/XML/Unix/C++
dmkarr@earthlink.net   ; SCJP; SCWCD




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


Help on installing struts-el

Posted by Richard Mixon <rn...@custco.biz>.
Where can I find instructions on how to use the struts-el version of struts
instead of the standard struts "lib" files? The README does not cover this
and that seems to be all there is in the way of doc.

I'm laboring under the assumption that struts-el is a super-set of struts. I
should be able to move my existing application over and have it use the
"struts-el" jar files. I can then selectively change from, for example an
"<html:text" tag to an "<html-el:text" tag assuming I've setup the TLD's
correctly for my taglibs.

I had a document that explained it well - but tossed it the other day,
thinking I was not going to need it for a while. Guess what, I need it now
<:-). I remember that it said you needed to first use the standard struts
"lib" files and then selectively replace them with the files in the
"contrib" lib directory. I've been Googling for hours and searching the
archive - cannot find anything substantiative.

I tried just using the contrib/struts-el/lib directory files, but end up
getting errors from the validation javascripts issued by my
"<html:javascript" tags (cannot find the "required" validation).

Any pointers or advice are appreciated.

Thanks - Richard



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


Re: My LogonView.jsp Displays A Blank Page

Posted by "David M. Karr" <dm...@earthlink.net>.
>>>>> "Caroline" == Caroline Jen <ji...@yahoo.com> writes:

    Caroline> My LogonView.jsp displays a blank page. I have no idea
    Caroline> why nothing is written while the
    Caroline> MessageResources.properties file is found. 

    Caroline> I would have gotton HTTP Status 500 if the
    Caroline> MessageResources.properties is not found or the value
    Caroline> of the corresponding key in the bean:message tag
    Caroline> cannot be picked up.  I did not get any error message.
    Caroline>  I cannot figure out the reason.  Please help.

Did you check your server log file?

-- 
===================================================================
David M. Karr          ; Java/J2EE/XML/Unix/C++
dmkarr@earthlink.net   ; SCJP; SCWCD




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


Re: My LogonView.jsp Displays A Blank Page

Posted by Jason Lea <ja...@kumachan.net.nz>.
I can't see anything wrong, I'll ask some questions :)

How are you accessing the logonView.jsp?  Requesting it directly or 
through an Struts Action?

Where is the MessageResources.properties file?  I see you use 
<param-value>resources.version1.MessageResources</param-value> which 
means it should be somewhere like 
/WEB-INF/classes/resources/version1/MessageResources.properties

If you went through an action, does the action actually forward to 
logonView.jsp?  What is in your struts-config.xml?

Perhaps your log files will show what Struts did with the request?

--jason

Caroline Jen wrote:
> 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:
> -------------------------------------------------------
> <?xml version="1.0" encoding="ISO-8859-1"?>
> 
> <!DOCTYPE web-app
>   PUBLIC "-//Sun Microsystems, Inc.//DTD Web
> Application 2.2//EN"
>   "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
> 
> <web-app>
>   <display-name>Struts Application</display-name>
>   
>   <!-- Standard Action Servlet Configuration (with
> debugging) -->
>   <servlet>
>     <servlet-name>action</servlet-name>
>    
> <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
>     <init-param>
>       <param-name>application</param-name>
>      
> <param-value>resources.version1.MessageResources</param-value>
>     </init-param>
>     <init-param>
>       <param-name>mapping</param-name>
>      
> <param-value>org.apache.struts.action.RequestActionMapping</param-value>
>     </init-param>
>     <init-param>
>       <param-name>config</param-name>
>      
> <param-value>/WEB-INF/struts-config.xml</param-value>
>     </init-param>
>     <init-param>
>       <param-name>debug</param-name>
>       <param-value>2</param-value>
>     </init-param>
>     <init-param>
>       <param-name>detail</param-name>
>       <param-value>2</param-value>
>     </init-param>
>     <load-on-startup>2</load-on-startup>
>   </servlet>
> 
> 
>   <!-- Standard Action Servlet Mapping -->
>   <servlet-mapping>
>     <servlet-name>action</servlet-name>
>     <url-pattern>*.do</url-pattern>
>   </servlet-mapping>
> 
> 
>   <!-- The Usual Welcome File List -->
>   <welcome-file-list>
>     <welcome-file>index.jsp</welcome-file>
>   </welcome-file-list>
> 
> 
>   <!-- Struts Tag Library Descriptors -->
>   <taglib>
>     <taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri>
>    
> <taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
>   </taglib>
> 
>   <taglib>
>     <taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
>    
> <taglib-location>/WEB-INF/struts-html.tld</taglib-location>
>   </taglib>
> 
>   <taglib>
>     <taglib-uri>/WEB-INF/struts-logic.tld</taglib-uri>
>    
> <taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
>   </taglib>
> 
>   <taglib>
>    
> <taglib-uri>/WEB-INF/struts-nested.tld</taglib-uri>
>    
> <taglib-location>/WEB-INF/struts-nested.tld</taglib-location>
>   </taglib>
> 
>   <taglib>
>     <taglib-uri>/WEB-INF/struts-tiles.tld</taglib-uri>
>    
> <taglib-location>/WEB-INF/struts-tiles.tld</taglib-location>
>   </taglib>
> 
>   <taglib>
>    
> <taglib-uri>/WEB-INF/struts-template.tld</taglib-uri>
>    
> <taglib-location>/WEB-INF/struts-template.tld</taglib-location>
>   </taglib>
> 
> </web-app>
> 
> -------------------------------------------------------
> 
> 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=<H2>Enter your user information</H2>
> title.logon=Logon Screen
> error.invalid.logon=<li>The User ID and/or Password
> are invalid. Please try again.</li>
> errors.header=<h3><font color="red">Validation
> Error</font></h3>You must correct the following
> error(s) before proceeding:<ul>
> title.mainmenu=Welcome
> heading.mainmenu=<H1>Welcome!</H1>
> label.userType=<H2>You are authorized to use this
> system as a</H2>
> errors.prefix=<LI>
> errors.suffix=</LI>
> errors.footer=</UL><hr>
> errors.invalid={0} is invalid.
> errors.maxlength={0} can not be greater than {1}
> characters.
> errors.minlength={0} can not be less than {1}
> characters.
> errors.range={0} is not in the range {1} through {2}.
> errors.required={0} is required.
> errors.byte={0} must be an byte.
> errors.date={0} is not a date.
> errors.double={0} must be an double.
> errors.float={0} must be an float.
> errors.integer={0} must be an integer.
> errors.long={0} must be an long.
> errors.short={0} must be an short.
> errors.creditcard={0} is not a valid credit card
> number.
> errors.email={0} is an invalid e-mail address.
> errors.cancel=Operation cancelled.
> errors.detail={0}
> errors.general=The process did not complete. Details
> should follow.
> errors.token=Request could not be completed. Operation
> is not in sequence.
> welcome.title=Struts Blank Application
> welcome.heading=Welcome!
> welcome.message=To get started on your own
> application, copy the struts-blank.war to a new WAR
> file using the name for your application. Place it in
> your container's "webapp" folder (or equivalent), and
> let your container auto-deploy the application. Edit
> the skeleton configuration files as needed, restart
> your container, and you are on your way! (You can find
> the application.properties file with this message in
> the /WEB-INF/src/java/resources folder.)
> 
> -------------------------------------------------------
> 
> Here is my LogonView.jsp:
> 
> 
> code:
> -------------------------------------------------------
> <!-- LogonView.jsp -->
> 
> <%@ taglib uri="/WEB-INF/struts-html.tld"
> prefix="html" %>
> <%@ taglib uri="/WEB-INF/struts-bean.tld"
> prefix="bean" %>
> 
> <html>
> <head><title><bean:message key="title.logon"
> /></title>
> <html:javascript formName="logon" />
> </head>
> <body bgcolor="white">
> <bean:message key="heading.logon" />
> <html:errors />
> <html:form action="/logon" onsubmit="return
> validateLogon(this)" >
> 
>            <bean:message key="logonForm.userId" />:
> 	   <html:text property="userId" size="10" />
> 
>            <bean:message key="logonForm.password" />:
> 	   <html:password property="password" size="10" />
> 
>             <html:submit>
>                 <bean:message key="button.submit" />
>             </html:submit>
> 
>             <html:reset>
>                 <bean:message key="button.reset" />
>             </html:reset>
> 
> </html:form>
> </body>
> </html>
> -------------------------------------------------------
> 
> 
> __________________________________
> 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
> 
> 


-- 
Jason Lea


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