Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Struts 2 »

Re: specify html:form action property

Joseph McGranaghan

2007-01-17

Replies:

That MappingDispatchAction sounds like a good idea.

What if you use JSTL/EL to navigate the servlet api and do a
similar filter for /admin/* etc?

Could do it in a javascript function onSubmit.

-Joe

Ilja S. wrote:
> The thing is that I use MappingDispatchAction
> So in one action class I have 2 methods: 1 will be executed when
> /supervisor/deals is accessed and other when /admin/deals is executed.
> I found this convenient for handling authorization (user with role
> supervisor can't access /admin/* urls) and having one Action class for
> few tasks. The problem here that I also want to use one JSP for those
> mappings and submit form in this jsp to corresponding mapping.
>
> Joseph McGranaghan wrote:
>> What if you use a DispatchAction and one path.
>> Either way you will need to check a parameter (or something)
>> to ensure the proper route
>>
>> -Joe
>>
>> Ilja S. wrote:
>>> Hello
>>> This could be silly question but I'm kind stuck here.
>>> I have 2 ActionMappings in struts config with following paths:
>>> path="/admin/deals"
>>> path="/supervisor/deals"
>>> Both have the forward to same jsp with form.
>>> All I want to do is depending on a requested mapping submit form,
>>> well, to its' action i.e.
>>> if /admin/deals page is opened then it would be <html:form
>>> action="/admin/deals.do"> and if /supervisor/deals url is opened
>>> then form would be submitted to "/supervisor/deals.do".
>>> Getting servletPath() from request object gives me smth like
>>> /layout/layout.jsp since struts Tiles is used.
>>>
>>> Thanks in advance.
>>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

©2008 junlu.com - Jax Systems, LLC, U.S.A.