RE: Action to JSP

2004-01-09 Thread Wendy Smoak
 There are a way to: 
 When a click in a link in my jsp page, in address bar in my 
 browser dont write the name of the action, and go direct to 
 the jsp page (defined in action forward) ???

Most of us go to great lengths to prevent users from accessing the JSPs
directly, including putting them under WEB-INF or behind a security
constraint.

But if you have JSP's that don't need Action code in front of them, just
put them somewhere accessible and use a plain old a
href=filename.jspLink/a.  If the link text/location needs to be
dynamic, JSTL can be of help.

However, if there are any Struts tags on the target JSP, they probably
won't work right unless you go through an Action first.

-- 
Wendy Smoak
Application Systems Analyst, Sr.
ASU IA Information Resources Management 



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



Re: Action to JSP

2004-01-09 Thread Vanessa Monteiro
Hi Mauricio

can you send your caller jsp, the mapping and the action class?

Vanessa

 [EMAIL PROTECTED] 09/01/2004 17:51:46 
There are a way to: 

When a click in a link in my jsp page, in address bar in my browser
dont write the name of the action, and go direct to the jsp page
(defined in action forward) ???

Thanks.
Mauricio


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



Re: Action to JSP

2004-01-09 Thread Geeta Ramani
The easiest way is perhaps to simply add a redirect=true in your action mapping.  
However, be aware that this will kill your request attributes (since your request
object is no longer forwarded..)

Regards,
Geeta

Mauricio T. Ferraz wrote:

 There are a way to:

 When a click in a link in my jsp page, in address bar in my browser dont write the 
 name of the action, and go direct to the jsp page (defined in action forward) ???

 Thanks.
 Mauricio


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



Re: Action to JSP

2004-01-09 Thread Mauricio T. Ferraz
Sorry Vanessa, I didn´t undestand.
I just want to execute the action e show the jsp, but in my address bar I
want to show the jsp page not the action (action.do)

[]´s



 Hi Mauricio

 can you send your caller jsp, the mapping and the action class?

 Vanessa

  [EMAIL PROTECTED] 09/01/2004 17:51:46 
 There are a way to:

 When a click in a link in my jsp page, in address bar in my browser
 dont write the name of the action, and go direct to the jsp page
 (defined in action forward) ???

 Thanks.
 Mauricio


 -
 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]



RE: Action to JSP

2004-01-09 Thread Wendy Smoak
 From: Mauricio T. Ferraz [mailto:[EMAIL PROTECTED] 
 I have do execute a Action and go to a jsp 
 page, but I
 dont want to show the name of the action in my address bar
 (htt://www.domain.com/someaction.do) I dont want this.
 When I execute the action I want to show the jsp, p.e.
 (htt://www.domain.com/mypage.jsp)

Then set redirect=true, but 
1. you'll lose any request parameters (put them in session scope?) 
2. it's going to be possible for people to go directly to your jsp's, so
you'll have to check that that hasn't happened.  Code/tag on the JSP?
Filter?  Place something in the session in the Action, then look for it
in the Filter before allowing the request through to the JSP, otherwise
forward it to the Action instead?  

(Wild guess... The marketing department doesn't think the .do URL's are
pretty?  Just curious!)

-- 
Wendy Smoak
Application Systems Analyst, Sr.
ASU IA Information Resources Management 

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



Re: Action to JSP - Works!!!

2004-01-09 Thread Mauricio T. Ferraz
Thanks People

Works!!!

Thanks Geeta for the solution

[]´s
Mauricio


- Original Message -
From: Geeta Ramani [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Friday, January 09, 2004 6:06 PM
Subject: Re: Action to JSP


 The easiest way is perhaps to simply add a redirect=true in your action
mapping.  However, be aware that this will kill your request attributes
(since your request
 object is no longer forwarded..)

 Regards,
 Geeta

 Mauricio T. Ferraz wrote:

  There are a way to:
 
  When a click in a link in my jsp page, in address bar in my browser dont
write the name of the action, and go direct to the jsp page (defined in
action forward) ???
 
  Thanks.
  Mauricio


 -
 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]



Re: Action to JSP

2004-01-09 Thread Vanessa Monteiro
Guess there was a two sided misunderstanding ;)

I'm new at struts but I don't think you can do that. 
What you can do is change your url-pattern to something like *.jspa and
name you action with the same name as your jsp and the browser will show
(ex.) index.jspa

Vanessa

 [EMAIL PROTECTED] 09/01/2004 18:11:12 
Sorry Vanessa, I didn t undestand.
I just want to execute the action e show the jsp, but in my address bar
I
want to show the jsp page not the action (action.do)

[] s



 Hi Mauricio

 can you send your caller jsp, the mapping and the action class?

 Vanessa

  [EMAIL PROTECTED] 09/01/2004 17:51:46 
 There are a way to:

 When a click in a link in my jsp page, in address bar in my browser
 dont write the name of the action, and go direct to the jsp page
 (defined in action forward) ???

 Thanks.
 Mauricio



-
 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]



Re: Action to JSP - Works!!!

2004-01-09 Thread Brice Ruth
be aware that this is not a good thing to do in general ... as you'll 
never be able to make use of the request scope for variables which 
*will* bite you at some point down the road.

If someone doesn't like the *.do at the end of the action name, then you 
really need to address a solution other than redirecting everything to JSPs.

Just my $0.02.

Mauricio T. Ferraz wrote:

Thanks People

Works!!!

Thanks Geeta for the solution

[]´s
Mauricio
- Original Message -
From: Geeta Ramani [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Friday, January 09, 2004 6:06 PM
Subject: Re: Action to JSP
 

The easiest way is perhaps to simply add a redirect=true in your action
   

mapping.  However, be aware that this will kill your request attributes
(since your request
 

object is no longer forwarded..)

Regards,
Geeta
Mauricio T. Ferraz wrote:

   

There are a way to:

When a click in a link in my jsp page, in address bar in my browser dont
 

write the name of the action, and go direct to the jsp page (defined in
action forward) ???
 

Thanks.
Mauricio
 

-
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]
 

--
Brice D. Ruth
Sr. IT Analyst
Fiskars Brands, Inc.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Action to JSP

2004-01-09 Thread Craig R. McClanahan
Quoting Geeta Ramani [EMAIL PROTECTED]:

 The easiest way is perhaps to simply add a redirect=true in your action
 mapping.  However, be aware that this will kill your request attributes
 (since your request
 object is no longer forwarded..)
 

Geeta's warning about one consequence is quite correct.  So is the warning that
you're going to make the performance of your application worse, because a
redirect requires an extra round trip to the client (a forward is basically a
glorified subroutine call that happens only on the server, which is why the
browser doesn't change it's address -- it never knew what happened).

personal-opinion
In a web *applicaton* (as opposed to a web *site*), URLs should be thought of as
an internal implementation detail, not a primary user-accessible feature.  If
you find your users getting distracted by the displayed URLs (or, worse, trying
to bookmark them, which will never work unless your app takes pains to make it
work), consider creating a frameset with a single frame in it (so the shown
address never changes), or use JavaScript to create a new window that does not
have a location bar.

Other folks will disagree with me on this, of course, but in my general response
is show me where the back button and bookmarks window are in a Swing app, and
I'll make them available in my web app.  :-)
/personal-opinion

 Regards,
 Geeta
 

Craig McClanahan


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



RE: Action to JSP

2004-01-09 Thread Joe Hertz
Craig, 

I agree with everything you said, but would absolutely love a clarification 
from you on the following:

 Other folks will disagree with me on this, of course, but in 
 my general response is show me where the back button and 
 bookmarks window are in a Swing app, and I'll make them 
 available in my web app.  :-)

I share your philosophy about how web^H^H^H applications should work, but 
there's a place where this philosophy abandons me.

So I respond:

If it's supposed to work like a swing app, then get rid of the bookmarks 
window and back button. Either that or make them unobtrusive.

And now you know why I hate Web UI design. :-/

As such, this makes me an utter newb for the more esoteric front end issues 
involving a browser.

So since my pre-struts experience put me mostly on the back end of web 
applications, what would you say are the best options for dealing with these 
things (struts or not) in a web application? 

I mean, I don't care if the back button still exists, but I don't want the 
user cursing my name every time he presses it without thinking about it. I 
personally _really_ hate it when this happens to me on my bank's site. 

TIA,

Joe



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



Re: action to jsp form to action and validation failure problem.

2002-12-11 Thread James Mitchell
On Wed, 2002-12-11 at 22:00, g h wrote:
 Hi everyone,
 
 Im new to structs so please be gentle.
 
 I have an action that forwards onto a jsp page with a form.
 When the form buttons are pressed a different action is called.
 
 Action1 --- testform.jsp --- Action2
 
 All works fine if the form passes validation.
 
 When the form fails validation, I expect to be returned back to the
 jsp form with some handy error messages. Instead all I get is a blank 
 html page (htmlbody/body/html) and no error messages (and no 
 errors from Jetty either).
 
 Any clue what Im doing wrong?
 
 Peter.
 


What's probably happening is an error is occuring that is being
swallowed (at some point) and leaves you puzzled as to its origin. 

This has happened to me on occasion, and if a detailed search through my
container's logs doesn't turn up anything, then its time to add more
(strategically placed) debug statements to my code.  That's always
helped me out of whatever mess I've created.

--
James Mitchell


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




Re: action to jsp form to action and validation failure problem.

2002-12-11 Thread Rick Reumann
 
  Im new to structs so please be gentle.
  
  I have an action that forwards onto a jsp page with a form.
  When the form buttons are pressed a different action is called.
  
  Action1 --- testform.jsp --- Action2
  
  All works fine if the form passes validation.
  
  When the form fails validation, I expect to be returned back to the
  jsp form with some handy error messages. Instead all I get is a
  blank html page (htmlbody/body/html) and no error messages
  (and no errors from Jetty either).
  
  Any clue what Im doing wrong?
  

Not exactly sure, although I've gotten similar blank pages before. 
Double check that you have the input=somejsp.jsp in your action
mapping in the struts-config.xml. Use a debugger or put a print on the
top of the jsp page to see if you are even being returned to the
correct page if validation produces errors. (If all you are getting as
you show above then you probably aren't). 

-- 

Rick

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




Re: Action and Jsp / passing Parameters

2001-11-23 Thread Jin Bal

In you action class you can set an object into the request using
request.setAttribute().  This object could be of a generic type that you
could examine in the jsp using a jsp:usebean tag to extract the object from
the request.  The action class always forwards the request object it has
back to the JSP so the object that you set in it will exist in the JSP that
you have forwarded to

HTH

Jin
- Original Message -
From: Mohammed [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, November 23, 2001 9:16 AM
Subject: Action and Jsp / passing Parameters


 Hello everybody,

 In my web application I decided not to use frames and so I am using a
table
 in a jsp file. my question is as follow:

 in the jsp file I want to know which action forwarded to this jsp file so
 that I will accordingly run the right code? Is der a way I could pass a
 Parameter from my Action class to the jsp file I am forwarding to ?
Actually
 I want to include the corresponding  jsp file into my main jsp file
 according to where the forward came from.

 Thanks for any Help

 Mohammed




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



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