• 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

Calling action without form (Struts)

 
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a .jsp page that
does NOT need to be accessed by typing the
URL. I would like to make sure that a user is logged in.
Once the user has been deemed invalid,I want to forward
it to the login page.

I do the following:


But using the response.sendRedirect(..), seems not to work.

Is there any other way to accomplish that?

Thanks

Zak
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Zak,
In your example, response.redirect() is commented out. I assume it is uncommented when you try it. What error did it give you?
 
Ranch Hand
Posts: 1312
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
please post your error message for more detail in this problem.
 
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Zak Nixon:
I do the following:


But using the response.sendRedirect(..), seems not to work.

Is there any other way to accomplish that?
Zak[/QB]



it can be done like this:
declare a global forward like this in struts config;

<global-forwards>
<forward name="login" path="/Login.do"/>

Login.do has an entry under action mappings
<action-mappings>
<action path="/Login" forward="/admin/login.jsp" type="org.apache.struts.actions.ForwardAction"/>

you may declare actions mappings to suit your needs.

 
reply
    Bookmark Topic Watch Topic
  • New Topic