• 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
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

module level struts-config.xml file

 
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think I am not clear about how to access the jsp file. I need some help. I am using myeclipse 5.x version. Here is my web.xml and struts-config-Test.xml files.

I want to know what url I have to give to access testindex.do

http://localhost:8080/UI/testindex.do ...invalid path error

web.xml
******************************************************
<init-param>
<param-name>config/Test</param-name>
<param-value>/WEB-INF/struts-config-Test.xml</param-value>
</init-param>
************************************************************

Struts-config-Test.xml


**************************************
<struts-config>
<data-sources />

<form-beans >
<form-bean name="testForm" type="org.apache.struts.validator.DynaValidatorForm">
<form-property name="firstname" type="java.lang.String" />
</form-bean>
</form-beans>


<action-mappings >

My test.jsp is under Webroot/Test/test.jsp. My project name is UI


<action
attribute="testForm"
input="/Test/test.jsp"
name="testForm"
path="/test"
scope="request"
type="com.mycompany.struts.action.TestAction" />

<action forward="/Test/test.jsp" path="/testindex"/>

</action-mappings>

<controller />

<message-resources
parameter="com.mycompany.struts.ApplicationResources" />


<plug-in className="org.apache.struts.validator.ValidatorPlugIn">
<set-property property="pathnames" value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/>
</plug-in>

</struts-config>
**************************************
I want to know what url I have to give to access /testindex.do
 
Ranch Hand
Posts: 190
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
test.do would call your action. You would then return a mapping.findForward() in your action to forward to the redirect you have specified.
 
shah rah
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have this in my struts-config-Test.xml

<action forward="/Test/test.jsp" path="/testindex"/>

so if I say http://localhost:8080/UI/testindex.do it should show me test.jsp but says invalid path??
 
If you try to please everybody, your progress is limited by the noisiest fool. And this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic