• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How Can hide your JSP in Struts2?

 
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys,

Is there a method on how to hide your jsp in struts2? You can hide your servlets in web.xml... There should be a style like this in struts2.

I dont want my i don't want my users to go directly to main.jsp because they must login first in the index.jsp. Thank you gurus..

<struts>
<package name="login" namespace="/" extends="struts-default">

<action name="login"
class="lotmovement.action.LoginAction">
<result name="input">/index.jsp</result>
<result name="success">/main.jsp</result>

</action>

</package>
</struts>
 
victor chiong
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
instead of main.jsp, what the users can see is like mx125.abc or etc..
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What good would renaming the resource do? A user would still be able to access it. You should look at the declarative security mechanism built into Java: Securing Web Applications.
 
victor chiong
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for that I will also look into that one. What I mean is that is their a way in struts2 just like in the servlets below? There is a mapping?

<servlet>
<servlet-name>Ch3 Beer</servlet-name>
<servlet-class>com.example.web.BeerSelect</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>Ch3 Beer</servlet-name>
<url-pattern>/SelectBeer.do</url-pattern>
</servlet-mapping>
 
Joe Ess
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

victor chiong wrote:What I mean is that is their a way in struts2 just like in the servlets below? There is a mapping?



There is a mapping for Struts in web.xml (in Struts 2, it is actually implemented as a filter).
If you want to protect your pages from being accessed by users who aren't logged in, the best practice is to use the declarative security I linked to earlier.
 
A wop bop a lu bob a womp bam boom. Tutti frutti ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic