• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Runing an example struts application

 
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to run rr_lesson1 project on WSAD5.0.
"http://www.reumann.net/struts/lesson1.do."
After enetering name and age and press submit button i am getting blank page and log shows like this.Can any one tell me what this means? and how to fix it?. I tried all the lessons and getting the same problem whn submits.


[4/11/05 19:02:52:661 PDT] 2df70b40 WebGroup I SRVE0180I: [Struts rr lesson 2] [/rrlesson2] [Servlet.LOG]: action: Processing a GET for /setUpEmployeeForm
[4/11/05 19:02:52:661 PDT] 2df70b40 WebGroup I SRVE0180I: [Struts rr lesson 2] [/rrlesson2] [Servlet.LOG]: action: Setting locale 'en_US'
[4/11/05 19:02:52:661 PDT] 2df70b40 WebGroup I SRVE0180I: [Struts rr lesson 2] [/rrlesson2] [Servlet.LOG]: action: Looking for ActionForm bean under attribute 'employeeForm'
[4/11/05 19:02:52:661 PDT] 2df70b40 WebGroup I SRVE0180I: [Struts rr lesson 2] [/rrlesson2] [Servlet.LOG]: action: Creating new ActionForm instance of class 'net.reumann.EmployeeForm'
[4/11/05 19:02:52:691 PDT] 2df70b40 WebGroup I SRVE0180I: [Struts rr lesson 2] [/rrlesson2] [Servlet.LOG]: action: Storing instance under attribute 'employeeForm' in scope 'request'
[4/11/05 19:02:52:701 PDT] 2df70b40 WebGroup I SRVE0180I: [Struts rr lesson 2] [/rrlesson2] [Servlet.LOG]: action: Populating bean properties from this request
[4/11/05 19:02:52:701 PDT] 2df70b40 WebGroup I SRVE0180I: [Struts rr lesson 2] [/rrlesson2] [Servlet.LOG]: action: Validating input form properties
[4/11/05 19:02:52:701 PDT] 2df70b40 WebGroup I SRVE0180I: [Struts rr lesson 2] [/rrlesson2] [Servlet.LOG]: action: Looking for Action instance for class net.reumann.SetUpEmployeeAction
[4/11/05 19:02:52:721 PDT] 2df70b40 WebGroup I SRVE0180I: [Struts rr lesson 2] [/rrlesson2] [Servlet.LOG]: action: Double checking for Action instance already there
[4/11/05 19:02:52:721 PDT] 2df70b40 WebGroup I SRVE0180I: [Struts rr lesson 2] [/rrlesson2] [Servlet.LOG]: action: Creating new Action instance

Thanks
Sudhakar
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
One possible cause of the problem of a blank page being returned in a Struts application is that of returning a null forward from the execute() method of an action class. Check to see that you have a statement similar to this:

return mapping.findForward("xyz");

at the end of your execute() method. Then check to see that the "xyz" represents a valid global forward, or a local forward for this action as defined in your struts-config.xml file.
 
sudhakar Tadepalli
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you for your suggetion. It is a local forward and looks like this.

public final class InsertEmployeeAction extends Action {

public ActionForward execute(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {
System.out.println("Here ..11");
EmployeeService service = new EmployeeService();
EmployeeForm employeeForm = (EmployeeForm) form;
EmployeeDTO employeeDTO = new EmployeeDTO();
BeanUtils.copyProperties( employeeDTO, employeeForm );
service.insertEmployee( employeeDTO );
request.setAttribute("employee",employeeDTO);
return (mapping.findForward("success"));
}
}

///struts-config.xml

<struts-config>
<!-- Form Bean Definitions -->
<form-beans>
<form-bean name="employeeForm" type="net.reumann.EmployeeForm"/>
</form-beans>
<!-- Action Mapping Definitions -->
<action-mappings>
<action path="/setupEmployeeForm" forward="/employeeForm.jsp"/>

<action path="/insertEmployee"
type="net.reumann.InsertEmployeeAction"
name="employeeForm"
scope="request"
validate="false"
>
<forward
name="success"
path="/confirmation.jsp"/>
</action>
</action-mappings>
<!-- message resources -->
<message-resources
parameter="ApplicationResources"
null="false" />
</struts-config>
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here are some more things to check:

  • use the browser's "view source" function to look at the blank page. Sometimes a page is being produced, but it has malformed html, and doesn't display.
  • Verify that action="insertEmployee" is specified on your <html:form> tag.

  • Put System.out.println() statements in your execute() method to verify that it is actually getting called.
  • change the way you're getting the forward so you can see whether it's successful or not, as in this example


  •  
    sudhakar Tadepalli
    Ranch Hand
    Posts: 130
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    I just figured the problem..Actually there is no problem with the WAR file, I just installed WSAD5.1.1 and ran the application it just works fine. Thank you for your help...I need one more help..I neeed to write left navigation jsp which i can in clude in my tiles lay out. I need a navigation which will have child links when you click on main link..and highliting the selected one etc..can some one give me an example or URL's ? Appreciate it.

    Thanks
    Sudhakar
     
    Opportunity is missed by most people because it is dressed in overalls and looks like work - Edison. Tiny ad:
    We need your help - Coderanch server fundraiser
    https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
    reply
      Bookmark Topic Watch Topic
    • New Topic