Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Dynamic page content in first jsp page

 
SoonAnn Lim
Ranch Hand
Posts: 155
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am trying to create login page with a selection box. Content of the selection box is dynamic, ie. I need an action class to generate the content for the selection. Most examples I read use a static jsp page that contains hard coded selection and username/password field.
I have tried to create an action class return the content of selection box. This action class is configured to forward user to login page. I have setup struts-config.xml with appropriate form-bean and action. However, when I type in the path pattern for <action> tags configured in struts-config.xml, I get 404 error. If i create a dummy .jsp page with a html form button with post action url pointing to the path pattern configured in struts-config.xml, everything works just fine.
Can someone give me a hint here?

Thanks
 
Eric Sexton
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you post the struts-config, web.xml and the URL that you are using?
 
SoonAnn Lim
Ranch Hand
Posts: 155
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
###########################################
#app_types is an array of DTO, which is
#a collection of Javabean class.
##############################################
<form-beans>
<form-bean name="beanForm"
dynamic="true"
type="org.apache.struts.action.DynaActionForm">
<form-property name="app_types"
type="java.util.Collection" />
</form-bean>
</form-beans>
###########################################
<action-mappings>
<action path="/test/pattern/input"
type="test.action.InputAction"
name="beanForm"
scope="request">
<forward name="logininput" path="/logininputpage.jsp" />
</action>
</action-mappings>
###########################################
I do not edit web.xml. It is the default comes with Tomcate 4.

Regards,
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic