Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to call a .do directly?

 
j luft
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why is it when I call a .do method directly,(http://myserver/myapp/myaction.do) it errors out because there is no session?? If I launch the app by default (
(http://myserver/myapp) ,then navigate to the .do I want, it works since there is a session. What am I doing wrong that it isn't creating the session ???
 
Ankit Garg
Sheriff
Posts: 9521
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it errors out because there is no session?

Can you elaborate on this more please. Where exactly do you get the error. If its in your Action code, then please show us the code of your action...
 
j luft
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a request processor that I added to forward people to the home page when their session is invalid... I added a line to allow the one action through that I want to be accessed directly (users are sent a link via email).

protected boolean processPreprocess(HttpServletRequest request, HttpServletResponse response) {
if (request.isRequestedSessionIdValid() == false) {
try {
Log.debug(this.getClass(), "session is no longer valid "+request.getRequestURL());
StringBuffer url = request.getRequestURL();


if ( url != null && url.indexOf("/license.do") > 0 ) {
return (true);
} else {
doForward("/index.jsp", request, response);
}
......

It allows me to get to the page now, but the session is still invalid(puts out the debug). When I get to the page, some of the stuff on the page does not render (html:rewrite for images etc)
and the form is not filled out. When I view source on the page, all the html: tag rendered with jsessionid=6d356793f802c2ba67c5f27bca8a56ea693130656f3fee2cf104b9f03ef56cf5 appended to the end of it... If I launch the app going to the home page first, then go to this action, everything works ok.... How do I get it to render correctly when I go directly to that action in a new browser?
Here is the definition of the action in my struts config;
<action path="/license"
type="app.action.SetupLicenseAgreeAction"
name="laForm"
scope="request">
<forward name="continue" path=".tile.licenseAgree"/>
</action>



 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic