You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Ilja S." <il...@frontdesk.ee> on 2007/01/17 14:09:32 UTC
specify html:form action property
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.
--
*************************************
Best Regards
Ilja
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: specify html:form action property
Posted by "Ilja S." <il...@frontdesk.ee>.
Sorry didn't get what you mean by "use JSTL/EL to navigate the servlet
api" :)
As I mentioned before request.getServletPath() gives Tiles layout jsp
page, not action mapping.
*************************************
Best Regards
Ilja
Joseph McGranaghan wrote:
> 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@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: specify html:form action property
Posted by Joseph McGranaghan <dr...@draegoonz.com>.
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@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: specify html:form action property
Posted by "Ilja S." <il...@frontdesk.ee>.
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@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: specify html:form action property
Posted by Joseph McGranaghan <dr...@draegoonz.com>.
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@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org