Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to modify extension .do to .web

Status
Not open for further replies.

Ngok

Programmer
Nov 15, 2004
4
CA
Is there a way to specify the extension of a struts action?

Example:

I'd like to change it to



I want to do this because I need to get rid of the security constraint for this action (only this one). This action must be accessible for everyone without going trough the login page (the user should not get the login page if he clicks on this link)

So, I was thinking to solve my problem by adding another security-constraint section into web.xml.

I'm not sure if this could work. Is there a way to tell struts that the action /Card/Provisioning/Create should be /Card/Provisioning/Create.web instead of Create.do ?

Thanks


struts-config.xml:

<action input="/Card/Provisioning/CreationInput.jsp" name="cardForm" path="/Card/Provisioning/Create" scope="request" type="com.gemplus.preview.gui.card.ProvisioningCreateAction" validate="true">
<forward name="forward" path="/Card/Provisioning/CreationResponse.jsp"/>
</action>


web.xml:

<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>


<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.web</url-pattern>
</servlet-mapping>


<security-constraint>
<web-resource-collection>
<web-resource-name>With auth-constraint</web-resource-name>
<url-pattern>*.do</url-pattern>
<http-method>GET</http-method>
<http-method>POST</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>serviceManager</role-name>
<role-name>csr</role-name>
</auth-constraint>
</security-constraint>


<security-constraint>
<web-resource-collection>
<web-resource-name>Without auth-constraint</web-resource-name>
<url-pattern>*.web</url-pattern>
<http-method>GET</http-method>
<http-method>POST</http-method>
</web-resource-collection>
</security-constraint>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top