RE: Can only redirect when forward path only has directories

2003-12-02 Thread Eric Bessette
I'm using Tomcat 4.1.2.  I looked through the server.xml file and couldn't
find anything that would do this.

I'm not familiar enough with struts to know what processes the ActionForward
that is returned from an Action.  Thanks for you input.

Thanks,
Eric

-Original Message-
From: David Friedman [mailto:[EMAIL PROTECTED]
Sent: Monday, December 01, 2003 7:57 PM
To: Struts Users Mailing List
Subject: RE: Can only redirect when forward path only has directories


You might want to check your web server configuration to see if the
directory index knows to show the index.jsp as the index page or to do
something else, such as redirect to an error page or a particular page.
What is your web server?

Regards,
David

-Original Message-
From: Bessette [mailto:[EMAIL PROTECTED]
Sent: Monday, December 01, 2003 10:30 PM
To: [EMAIL PROTECTED]
Subject: Can only redirect when forward path only has directories


After days of trying to figure out why my actions wouldn't forward, only
redirect, I finally narrowed down the problem.

If I use a forward path of /dir1/dir2 the action will always redirect, no
matter what the redirect value of the forward is.  However, if I use
/dir1/dir2/index.jsp then the action will redirect or forward correctly
depending on the value.

This seems like a bug to me.  Is there any reason why this should happen?
It doesn't really matter to me, since the action uri is displayed in the
address bar, but it seems very odd.

Thanks,
Eric


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Can only redirect when forward path only has directories

2003-12-01 Thread Bessette
After days of trying to figure out why my actions wouldn't forward, only
redirect, I finally narrowed down the problem.

If I use a forward path of /dir1/dir2 the action will always redirect, no
matter what the redirect value of the forward is.  However, if I use
/dir1/dir2/index.jsp then the action will redirect or forward correctly
depending on the value.

This seems like a bug to me.  Is there any reason why this should happen?
It doesn't really matter to me, since the action uri is displayed in the
address bar, but it seems very odd.

Thanks,
Eric


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Can't store object in request from an action

2003-11-17 Thread Eric Bessette
Thanks for the info.  It is redirecting to the jsp url, however the redirect
attribute is false.

Thanks,
Eric

-Original Message-
From: Max Cooper [mailto:[EMAIL PROTECTED]
Sent: Saturday, November 15, 2003 6:44 AM
To: Struts Users Mailing List
Subject: Re: Can't store object in request from an action


If the request arrives at the JSP from the input attribute on the action
mapping due to a validation error (from calling validate() on the
ActionForm), the action is not part of the processing loop. Struts calls
validate() and then forwards the request directly to the input JSP if a
validation error is encountered.

If there is no validation error occurring, it may be that you have the
redirect attribute of the forward set to true, which results in the action
processing the request and sending a redirect to the JSP, and then the
browser requests the JSP directly, which will be a new request (and thus
anything you put in the request in the action won't be visible to the JSP).
If the URL in the browser window shows the JSP's URL (instead of the Action
URL) at this point, that is what is happening.

-Max

- Original Message -
From: Bessette [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Friday, November 14, 2003 10:31 PM
Subject: RE: Can't store object in request from an action


 I know that's not the issue, because I also print out all of the request
 keys and their objects.

 The main purpose behind this is getting the ActionErrors and
ActionMessages
 to work properly.  I use saveErrors and saveMessages, but the
 html:messages tag doesn't display anything.

 If anyone has any insights, they'd be very appreciated.

 Thanks,
 Eric

 -Original Message-
 From: Richard Yee [mailto:[EMAIL PROTECTED]
 Sent: Friday, November 14, 2003 9:21 PM
 To: Struts Users Mailing List
 Subject: Re: Can't store object in request from an action


 Try this instead:

 ...
 %= request.getAttribute( testing ) %
 ...

 -Richard


 At 07:38 PM 11/14/2003, you wrote:
 I'm trying to set an attribute in the request scope from an action.
 However, when I do the following:
 
 ...
 public ActionForward execute(
  ActionMapping mapping,
  ActionForm form,
  HttpServletRequest request,
  HttpServletResponse response)
  throws Exception {
 
  request.setAttribute( testing, This is a test );
  return mapping.getInputForward();
 }
 ...
 
 and in my jsp page, I do:
 
 ...
 %= pageContext.findAttribute( testing ) %
 ...
 
 
 I always get null.  Is the request sent to the execute statement the same
 one used for the forward?  Could this be because I want to forward to the
 input jsp?  Please, please help me out.  I've been spinning my wheels for
a
 few days now trying to figure this out.
 
 Thanks,
 Eric
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]






-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



How to forward without redirect from action?

2003-11-16 Thread Bessette
I have an action that does the following:

public ActionForward execute(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {

request.setAttribute( testing, This is a test );

return new ActionForward( mapping.getInput(), false );
}

And I have a jsp page that has the following:

%= pageContext.findAttribute( testing ) %

The problem is the jsp page always prints null and the url is never that of
the action, always that of the page.  This means the action is always
redirecting to the input page no matter what I set the redirect variable in
the ActionForward to be.  How do I forward to the input page without
redirecting?

Here's my action mapping:
action-mappings
action
path=/home/feedback/Email
type=org.app.struts.action.EmailAction
name=feedback
validate=true
input=/home/feedback
/action
/action-mappings

If you have any ideas or need more info to help out, please let me know.

Thanks,
Eric


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Can't store object in request from an action

2003-11-14 Thread Bessette
I'm trying to set an attribute in the request scope from an action.
However, when I do the following:

...
public ActionForward execute(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {

request.setAttribute( testing, This is a test );
return mapping.getInputForward();
}
...

and in my jsp page, I do:

...
%= pageContext.findAttribute( testing ) %
...


I always get null.  Is the request sent to the execute statement the same
one used for the forward?  Could this be because I want to forward to the
input jsp?  Please, please help me out.  I've been spinning my wheels for a
few days now trying to figure this out.

Thanks,
Eric


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



How to hide index.jsp in forwards

2003-11-02 Thread Bessette
I have an action that forwards to it's input parameter, which is
/home/feedback.  However, when the action does forward to it's input, the
url is .../home/feedback/index.jsp.  This is the correct file, but I'd like
to the index.jsp part.

This is the output I'm getting:
...
10:32:14:014 org.apache.struts.action.RequestProcessor:
[DEBUG]
processForwardConfig(ForwardConfig[name=null,path=/home/feedback,redirect=fa
lse,contextRelative=false])
10:32:14:014 org.apache.catalina.core.ApplicationDispatcher:
[DEBUG] servletPath=/home/feedback, pathInfo=null, queryString=null,
name=null
10:32:14:014 org.apache.catalina.core.ApplicationDispatcher:
[DEBUG]  Path Based Forward
10:32:14:014 org.apache.catalina.core.ApplicationDispatcher:
[DEBUG]  Disabling the response for futher output
10:32:14:014 org.apache.struts.util.RequestUtils:
[DEBUG] Get module name for path /home/feedback/index.jsp
...

It looks like somewhere between the RequestProcessor and the RequestUtils,
the forward path gets changed.  Does anyone know where this happens?  I'm
not too familiar with the action lifecycle.

I was hoping there was one method in ActionServlet that I could overload to
remove the index.jsp part and send it to the super method.  I'd welcome any
ideas.

Thanks,
Eric


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Use iterate tag within a tiles putList tag

2003-11-01 Thread Bessette
I have one sidebar layout that is used by every sidebar.  I have another
sidebar layout that references the first one, excerpt below.  This second
layout is used by a series of pages that I would like to have the same
layout format.

Anyway, this is what I'd like to do, but the iterate tags are not getting
parsed, just passed through when rendered.  Any ideas?

Excerpt:
tile:importAttribute /

tile:insert definition=application.layout.sidebar flush=true
...
tile:putList name=Browse
logic:iterate id=by name=${ browse }
tile:add content=A HREF='${
pageContext.request.contextPath }/${ root }/browse/by_${ by }'By ${
application:capitalize( by ) }/A direct=true /
/logic:iterate
/tile:putList
...
/tile:insert

Output:
...
logic:iterate id=by name=[name, state, drainage]

/logic:iterate

UL
...
LI
Browse
/LI
UL
LI
A HREF='/application/destinations/browse/by_'By /A
/LI
/UL
...
/UL

Thanks,
Eric


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



tiles relative path in put tag

2003-10-30 Thread bessette
I have a definition like this:

definition name=tiles.layout.main path=/common/layout/main.jsp
  put name=header  value=/common/jsp/header.jsp /
  put name=menuvalue=/common/jsp/menu.jsp /
  put name=sidebar value=OVERLOAD /
  put name=content value=OVERLOAD /
  put name=footer  value=/common/jsp/footer.jsp /
/definition

And I'd like to overload it like this: (index.jsp)

tiles:insert definition=tiles.layout.main flush=true
  tiles:put name=sidebar value=sidebar.jsp /
  tiles:put name=content value=content.jsp /
/tiles:insert

Where index.jsp, sidebar.jsp, and content.jsp are all in the same directory.

When I access this page, nothing gets displayed and no errors are logged.  However, if 
I use 
the full path, then everything works fine.

Is there some way to use relative paths in the put tag?

Thanks,
Eric


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]