aspose file tools*
The moose likes Struts and the fly likes Dynamic page content in first jsp page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Dynamic page content in first jsp page" Watch "Dynamic page content in first jsp page" New topic
Author

Dynamic page content in first jsp page

SoonAnn Lim
Ranch Hand

Joined: Jun 21, 2001
Posts: 155
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

Joined: Sep 12, 2003
Posts: 133
Can you post the struts-config, web.xml and the URL that you are using?
SoonAnn Lim
Ranch Hand

Joined: Jun 21, 2001
Posts: 155
###########################################
#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,
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Dynamic page content in first jsp page