• 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
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

module level struts-config.xml file

 
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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??
 
You can't expect to wield supreme executive power just because
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!