(see inserted comments)

Galbreath, Mark wrote:

>Read the book:
>
>http://www.theserverside.com/resources/strutsreview.jsp
>
Very good book - highly recommended.  It's available for ordering on 
Amazon now too!

>Mark (the lesser-known struts-user FEATURE!)
>
>-----Original Message-----
>From: Ashish Kulkarni [mailto:[EMAIL PROTECTED]]
>Sent: Wednesday, August 21, 2002 12:19 PM
>
>1. If i have to do some validation regarding the input from the user on
>input fields i was using javascript, and onSubmit method of form, but with
>struts i think i cannot use javascript, so how can i do it before sumbitting
>the data to action class where i will be calling perform to do the business
>logic.
>
>(Can anyone supply some code)
>
See the chapter on the Validator Frameowrk.

>2. if i have to send some parameters to jsp, i was appending them as query
>string, but these parameters are build on fly, how can i do it with sturts.
>
Have a close look at 
javax.servlet.http.HttpServletRequest.setAttribute() and 
...HttpServletRequest.getAttribute().  It doesn't occur to me right off 
if Chuck talks about this in his book, but it's really more of a 
JSP/Servlet question than a Struts-specific question.  If I understand 
your question, those should help you out.  If I don't understand, it's 
conceivable you may want to look into the Dyna-forms too 
(DynaForm/DynaValidatorForm/DynaValidatorActionForm).  There are many 
ways to do just about anything you could imagine to be done.  Struts can 
simplify many of them.

>3. I had a header jsp which checked it the user had valid session, and if
>not forward it to logon page, how can i modify this jsp with struts
>
Look at extending org.apache.struts.action.Action.  Before you do, make 
sure you understand the role that action classes play in the overall 
Struts framework.  You could add this functionality to a class extending 
Action, and derive all of your actual actions from that action (so they 
all have that functionality implicitly).  Another solution is CMA 
(Container-managed authentication).  Yet another approach is JAAS - many 
folks are looking to this nowadays because of perceived limitations of 
CMA.  Personally, I'd rather let someone else write my authentication - 
even if it means I have to use some trickery to make it behave the way I 
want.  You can find many threads about security and container-managed 
authentication in the archives.  Try a search.  I don't have the URL for 
the archive right off, but there is a link to it on the same page where 
you subscribed to the mailing list.

HTH,

Eddie



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

Reply via email to