Hi Rajil,

You are absolutely right.. We can extend ActionServlet and can solve this
prob...
But here for my project i am using Struts 1.3 and i am planning to use
custom Requestprocessor class with 
processRoles method. If we are extending ActionServlet  then we can easily
forward  one using mapping.findForward("noRole"). But how can i perform the
same from this processRoles method in CustomRequest processor class ?..It is
accepting only boolean return values......

Shall we use any thing like response.sendRedirect or some thing else.....
response.sendRedirect will work but we should provide the jsp path instead
of an action path. Any other solutions plz help...

If anything wrong plz correct me also..

Thanks in Advance,

Crazy Worker.



rajil wrote:
> 
> Hi Crazy;
> 
> Well, I given example of extending ActionServlet class itself.
> 
> You also can do this by extending RequestProcessor method.
> 
> If you are using extension of ActionServlet you don't have to specify it
> in
> struts-config.xml file, instead you need to specify it in web.xml file.
> 
> That is;
> 
> Instead of writing ActionServlet entry into your web.xml file you need to
> write this class as your entry point
> 
> e.g.
> 
>   <servlet>
>     <servlet-name>action</servlet-name>
>     <servlet-class>com.xyz.project.utils.CustActionServlet</servlet-class>
>       ...
>       ...
> 
> 
> But if you are using RequestProcessor,  you don't have to change your
> web.xml's ActionServlet entry.  But you have to specify RequestProcessor
> class.
> 
> Regards,
> 
> Rajil
> 
> -----Original Message-----
> From: ECLIPSE + CVS [mailto:anishpis...@gmail.com] 
> Sent: Saturday, January 10, 2009 3:09 PM
> To: user@struts.apache.org
> Subject: RE: RequestProcessor Issue
> 
> 
> Hi Rajil ,
> 
> First of all thanks a lot for your  response...
> 
> But one more thing i need to get clarify from you..Where shold i specify
> this newly created class(newly created ActionServlet) in our project .
> Some
> where in Struts-config.xml  ?....
> 
> Thanks in Advance.
> 
> Crazy worker.
> 
> 
> 
> 
> 
> 
> rajil wrote:
>> 
>> Hi Crazy;
>> 
>> I had same requirement in one of my project.  And as I am using struts1.0
>> I
>> have extended ActionServlet class to validate all requests.
>> 
>> I have extended following method of ActionServlet.. 
>> 
>> protected ActionForward processActionPerform(Action arg0, ActionMapping
>> arg1, ActionForm arg2, HttpServletRequest arg3, HttpServletResponse arg4)
>> throws IOException, ServletException
>> {
>>      if(!(UserRights.validateUserRequestRights(arg1, arg3)))         
>>      {
>>              return arg1.findForward("unauthorized");
>>      }
>> 
>>      return super.processActionPerform(arg0, arg1, arg2, arg3, arg4);
>> }
>> 
>> I have global forward defined in Struts-config.xml
>> 
>> <forward name="unauthorized" path="accessdenied.jsp"/>
>> 
>> I hope above sample will help you.
>> 
>> Regards,
>> Rajil Davda
>> 
>> -----Original Message-----
>> From: ECLIPSE + CVS [mailto:anishpis...@gmail.com] 
>> Sent: Saturday, January 10, 2009 1:43 PM
>> To: user@struts.apache.org
>> Subject: RequestProcessor Issue
>> 
>> 
>> Hi,
>> 
>> I have a small query on Request Processor class. 
>> 
>> In my project i want to consider the user roles in some of the pages. For
>> that i am planning to extend the RequestProcessor class to create one
>> custom
>> request processor and handle the role based things in the processRoles
>> method. Here my problem is how can i show the "NO role message" in a new
>> jsp
>> page. From this method i tried to forward the response to a new action
>> eg:(/noRole.do) . But this action is not taking correctly. So i think
>> this
>> is not the right way to do this. Also if any thing wrong plz correct me
>> also.........
>> 
>> Plz help me....!!!
>> 
>> Thanks in Advance ,
>> 
>> Crazy Worker.
>> -- 
>> View this message in context:
>> http://www.nabble.com/RequestProcessor-Issue-tp21385918p21385918.html
>> Sent from the Struts - User mailing list archive at Nabble.com.
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> For additional commands, e-mail: user-h...@struts.apache.org
>> 
>> 
>> __________ NOD32 3755 (20090109) Information __________
>> 
>> This message was checked by NOD32 antivirus system.
>> http://www.eset.com
>> 
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> For additional commands, e-mail: user-h...@struts.apache.org
>> 
>> 
>> 
> 
> -- 
> View this message in context:
> http://www.nabble.com/RequestProcessor-Issue-tp21385918p21386399.html
> Sent from the Struts - User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
> 
> 
> __________ NOD32 3755 (20090109) Information __________
> 
> This message was checked by NOD32 antivirus system.
> http://www.eset.com
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/RequestProcessor-Issue-tp21385918p21396625.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Reply via email to