Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Dynamic page content in first jsp page

 
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
 
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,
 
    Bookmark Topic Watch Topic
  • New Topic