You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "jignesh(india)" <ji...@aspl.in> on 2008/01/18 06:51:35 UTC

Pretty urls without .action

Hi,
    I am having struts2 application ready with my tomcat server.Now i want
to host it with apache server,but it should be looks like pretty one.
I mean i want my urls without .action,.do or anything just like action name
nothing more.Is this possible in struts2
e.g 
https://kily.myseaversite.com/category.action should be work like
https://kily.myseaversite.com/category

Can anybody help me..?

Thanks in advanced
Br,jignesh

-- 
View this message in context: http://www.nabble.com/Pretty-urls-without-.action-tp14947106p14947106.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: Can I use one action for displaying and submission (with struts validation)

Posted by Laurie Harper <la...@holoweb.net>.
Paul Benedict wrote:
> You can use this pattern:
> 
> * Turn automatic validation off.
> 
> * If your action was executed as a GET, branch to viewing logic.
> 
> * If your action was executed as a POST, branch to validation logic and
> submission logic.

Another approach is to retain declarative validation and a single 
action, but use two action mappings. Both mappings point to the same 
action class, one has validation turned off and handles form display 
while the other has validation turned on and handles the submit.

You presumably already have some mechanism to distinguish form request 
from form submit, so you can apply Paul's solution substituting that 
mechanism for the GET vs. POST test.

L.


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


RE: Can I use one action for displaying and submission (with struts validation)

Posted by Dave Newton <ne...@yahoo.com>.
--- "Zhang, Larry (L.)" <lz...@ford.com> wrote:
> I am intested in knowing how to turn automatic validation off? How?

Automagic validation is controlled by the "validate" attribute in the
struts-config files.

> Also all my submission is also get (for some reasons in our project) 

That'll make it harder; is there any particular reason you can't just change
form submissions to POST? 

It certainly follows the spirit of HTTP a bit more closely and makes Msgr.
Benedictus' logic trivial to implement.

d.

> -----Original Message-----
> From: paulus.benedictus@gmail.com [mailto:paulus.benedictus@gmail.com]
> On Behalf Of Paul Benedict
> Sent: Friday, January 25, 2008 12:15 PM
> To: Struts Users Mailing List
> Subject: Re: Can I use one action for displaying and submission (with
> struts validation)
> 
> You can use this pattern:
> 
> * Turn automatic validation off.
> 
> * If your action was executed as a GET, branch to viewing logic.
> 
> * If your action was executed as a POST, branch to validation logic and
> submission logic.
> 
> Paul
> 
> ---------------------------------------------------------------------
> 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: Can I use one action for displaying and submission (with struts validation)

Posted by "Zhang, Larry (L.)" <lz...@ford.com>.
I am intested in knowing how to turn automatic validation off? How?
Using javascript to set the flag is not accepted by us.

Also all my submission is also get (for some reasons in our project) 

-----Original Message-----
From: paulus.benedictus@gmail.com [mailto:paulus.benedictus@gmail.com]
On Behalf Of Paul Benedict
Sent: Friday, January 25, 2008 12:15 PM
To: Struts Users Mailing List
Subject: Re: Can I use one action for displaying and submission (with
struts validation)

You can use this pattern:

* Turn automatic validation off.

* If your action was executed as a GET, branch to viewing logic.

* If your action was executed as a POST, branch to validation logic and
submission logic.

Paul

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


Re: Can I use one action for displaying and submission (with struts validation)

Posted by Paul Benedict <pb...@apache.org>.
You can use this pattern:

* Turn automatic validation off.

* If your action was executed as a GET, branch to viewing logic.

* If your action was executed as a POST, branch to validation logic and
submission logic.

Paul

Can I use one action for displaying and submission (with struts validation)

Posted by "Zhang, Larry (L.)" <lz...@ford.com>.
 
I was noticing an issue if I use one action for both displaying and
submission purposes:

Say MyAction.java is for displaying page and also for submission. If on
the page there is text field needing the struts validator validation,
then if failing validation, I forward to MyAction.java and comes to the
validation again, and fail again and forward to the MyAction again. This
is an infinite loop, any suggestions to overcome this and still use one
action? Or we have to use two actions(one display and one for
submission) the serve the purposes.

Thanks in advance.

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


Re: Pretty urls without .action

Posted by Zoran Avtarovski <zo...@sparecreative.com>.
In the simplest model you can take anything from your namespace and append a
.action to it. We use it more to create SEF parameter laden URLs.


I don't have a specific rule for what you're looking for but the
documentation is pretty concise and you can also look at the Apache
mod-rewrite rules (http://httpd.apache.org/docs-2.0/mod/mod_rewrite.html) on
which the library is based.

Z.


> 
> Thanks for the help! Would u please give some brief idea, about setting the
> rule in urlrewrite.xml?
> How can I remove .action suffix from each?
> 
> Thanks,
> Neha Bhatt
> 
> 
> Sparecreative wrote:
>> 
>> We have adopted using the URL Rewrite Filter
>> (http://tuckey.org/urlrewrite/)
>> which like Apache lets you use SEF addresses which are then mapped to
>> .action urls. 
>> 
>> Z.
>> 
>> 
>> 
>>> 
>>>  Hi,
>>> I think you missed something struts.action.extension=action,, leads to
>>> not
>>> actions without ".action" but to the actions with
>>> (action-name suffix(.)).
>>> 
>>> e.g
>>> http://localhost:8080/email (tends to 404 page not found) but
>>> 
>>> http://localhost:8080/email. (with suffix (.) works as ,, ).
>>> 
>>> 
>>> Jeromy Evans - Blue Sky Minds wrote:
>>>> 
>>>> neha bhatt wrote:
>>>>> I am facing same problem.
>>>>> I had tried :
>>>>> eg.
>>>>>  struts.action.extension=action,,
>>>>> 
>>>>> In such case I am getting Http Status 404.
>>>>> 
>>>>>   
>>>> As mentioned in the related post titled "Blank action extension in root
>>>> namespace causing 302 in Tomcat" (no link at time of posting), try a
>>>> non-root namespace.
>>>>> where as if I use,
>>>>> eg. 
>>>>> struts.action.extension=
>>>>> 
>>>>> All files with extenstion like: javascript , css and images not
>>>>> loading.
>>>>> 
>>>>>   
>>>> This is a slightly different configuration than a double comma:
>>>> 
>>>> struts.action.extension=
>>>> 
>>>> By setting it to blank, for every request that reaches the Struts2
>>>> filter (eg /*), Struts2 will attempt to match it to an action.  If you
>>>> take that broad approach you'll have to setup apache to serve the static
>>>> content as the V2.4 web.xml doesn't allow you to use <exlcludes> in the
>>>> filter mapping.
>>>> 
>>>> 
>>>> ---------------------------------------------------------------------
>>>> 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
>> 
>> 
>> 



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


Re: Pretty urls without .action

Posted by neha bhatt <ne...@gmail.com>.
Thanks for the help! Would u please give some brief idea, about setting the
rule in urlrewrite.xml?
How can I remove .action suffix from each?

Thanks,
Neha Bhatt


Sparecreative wrote:
> 
> We have adopted using the URL Rewrite Filter
> (http://tuckey.org/urlrewrite/)
> which like Apache lets you use SEF addresses which are then mapped to
> .action urls. 
> 
> Z.
> 
> 
> 
>> 
>>  Hi,
>> I think you missed something struts.action.extension=action,, leads to
>> not
>> actions without ".action" but to the actions with
>> (action-name suffix(.)).
>> 
>> e.g
>> http://localhost:8080/email (tends to 404 page not found) but
>> 
>> http://localhost:8080/email. (with suffix (.) works as ,, ).
>> 
>> 
>> Jeromy Evans - Blue Sky Minds wrote:
>>> 
>>> neha bhatt wrote:
>>>> I am facing same problem.
>>>> I had tried :
>>>> eg.
>>>>  struts.action.extension=action,,
>>>> 
>>>> In such case I am getting Http Status 404.
>>>> 
>>>>   
>>> As mentioned in the related post titled "Blank action extension in root
>>> namespace causing 302 in Tomcat" (no link at time of posting), try a
>>> non-root namespace.
>>>> where as if I use,
>>>> eg. 
>>>> struts.action.extension=
>>>> 
>>>> All files with extenstion like: javascript , css and images not
>>>> loading.
>>>> 
>>>>   
>>> This is a slightly different configuration than a double comma:
>>> 
>>> struts.action.extension=
>>> 
>>> By setting it to blank, for every request that reaches the Struts2
>>> filter (eg /*), Struts2 will attempt to match it to an action.  If you
>>> take that broad approach you'll have to setup apache to serve the static
>>> content as the V2.4 web.xml doesn't allow you to use <exlcludes> in the
>>> filter mapping. 
>>> 
>>> 
>>> ---------------------------------------------------------------------
>>> 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
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Pretty-urls-without-.action-tp14947106p15084025.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: Pretty urls without .action

Posted by Zoran Avtarovski <zo...@sparecreative.com>.
We have adopted using the URL Rewrite Filter (http://tuckey.org/urlrewrite/)
which like Apache lets you use SEF addresses which are then mapped to
.action urls. 

Z.



> 
>  Hi,
> I think you missed something struts.action.extension=action,, leads to not
> actions without ".action" but to the actions with
> (action-name suffix(.)).
> 
> e.g
> http://localhost:8080/email (tends to 404 page not found) but
> 
> http://localhost:8080/email. (with suffix (.) works as ,, ).
> 
> 
> Jeromy Evans - Blue Sky Minds wrote:
>> 
>> neha bhatt wrote:
>>> I am facing same problem.
>>> I had tried :
>>> eg.
>>>  struts.action.extension=action,,
>>> 
>>> In such case I am getting Http Status 404.
>>> 
>>>   
>> As mentioned in the related post titled "Blank action extension in root
>> namespace causing 302 in Tomcat" (no link at time of posting), try a
>> non-root namespace.
>>> where as if I use,
>>> eg. 
>>> struts.action.extension=
>>> 
>>> All files with extenstion like: javascript , css and images not loading.
>>> 
>>>   
>> This is a slightly different configuration than a double comma:
>> 
>> struts.action.extension=
>> 
>> By setting it to blank, for every request that reaches the Struts2
>> filter (eg /*), Struts2 will attempt to match it to an action.  If you
>> take that broad approach you'll have to setup apache to serve the static
>> content as the V2.4 web.xml doesn't allow you to use <exlcludes> in the
>> filter mapping. 
>> 
>> 
>> ---------------------------------------------------------------------
>> 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: Pretty urls without .action

Posted by Jeromy Evans <je...@blueskyminds.com.au>.
Was putting your actions in a non-root namespace not a suitable 
work-around?  Or did it not work for you?

jignesh.patel wrote:
>  Hi,
> I think you missed something struts.action.extension=action,, leads to not
> actions without ".action" but to the actions with
> (action-name suffix(.)).
>
> e.g
> http://localhost:8080/email (tends to 404 page not found) but
>
> http://localhost:8080/email. (with suffix (.) works as ,, ).
>
>
> Jeromy Evans - Blue Sky Minds wrote:
>   
>> neha bhatt wrote:
>>     
>>> I am facing same problem.
>>> I had tried :
>>> eg.
>>>  struts.action.extension=action,,
>>>
>>> In such case I am getting Http Status 404.
>>>
>>>   
>>>       
>> As mentioned in the related post titled "Blank action extension in root 
>> namespace causing 302 in Tomcat" (no link at time of posting), try a 
>> non-root namespace.
>>     
>>> where as if I use,
>>> eg. 
>>> struts.action.extension=
>>>
>>> All files with extenstion like: javascript , css and images not loading.
>>>
>>>   
>>>       
>> This is a slightly different configuration than a double comma:
>>
>> struts.action.extension=
>>
>> By setting it to blank, for every request that reaches the Struts2 
>> filter (eg /*), Struts2 will attempt to match it to an action.  If you 
>> take that broad approach you'll have to setup apache to serve the static 
>> content as the V2.4 web.xml doesn't allow you to use <exlcludes> in the 
>> filter mapping. 
>>
>>
>> ---------------------------------------------------------------------
>> 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: Pretty urls without .action

Posted by "jignesh.patel" <ji...@aspl.in>.
 Hi,
I think you missed something struts.action.extension=action,, leads to not
actions without ".action" but to the actions with
(action-name suffix(.)).

e.g
http://localhost:8080/email (tends to 404 page not found) but

http://localhost:8080/email. (with suffix (.) works as ,, ).


Jeromy Evans - Blue Sky Minds wrote:
> 
> neha bhatt wrote:
>> I am facing same problem.
>> I had tried :
>> eg.
>>  struts.action.extension=action,,
>>
>> In such case I am getting Http Status 404.
>>
>>   
> As mentioned in the related post titled "Blank action extension in root 
> namespace causing 302 in Tomcat" (no link at time of posting), try a 
> non-root namespace.
>> where as if I use,
>> eg. 
>> struts.action.extension=
>>
>> All files with extenstion like: javascript , css and images not loading.
>>
>>   
> This is a slightly different configuration than a double comma:
> 
> struts.action.extension=
> 
> By setting it to blank, for every request that reaches the Struts2 
> filter (eg /*), Struts2 will attempt to match it to an action.  If you 
> take that broad approach you'll have to setup apache to serve the static 
> content as the V2.4 web.xml doesn't allow you to use <exlcludes> in the 
> filter mapping. 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Pretty-urls-without-.action-tp14947106p15036384.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: Pretty urls without .action

Posted by Jeromy Evans <je...@blueskyminds.com.au>.
neha bhatt wrote:
> I am facing same problem.
> I had tried :
> eg.
>  struts.action.extension=action,,
>
> In such case I am getting Http Status 404.
>
>   
As mentioned in the related post titled "Blank action extension in root 
namespace causing 302 in Tomcat" (no link at time of posting), try a 
non-root namespace.
> where as if I use,
> eg. 
> struts.action.extension=
>
> All files with extenstion like: javascript , css and images not loading.
>
>   
This is a slightly different configuration than a double comma:

struts.action.extension=

By setting it to blank, for every request that reaches the Struts2 
filter (eg /*), Struts2 will attempt to match it to an action.  If you 
take that broad approach you'll have to setup apache to serve the static 
content as the V2.4 web.xml doesn't allow you to use <exlcludes> in the 
filter mapping. 


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


RE: Pretty urls without .action

Posted by neha bhatt <ne...@gmail.com>.
I am facing same problem.
I had tried :
eg.
 struts.action.extension=action,,

In such case I am getting Http Status 404.

where as if I use,
eg. 
struts.action.extension=

All files with extenstion like: javascript , css and images not loading.



Randy Burgess-3 wrote:
> 
> What about the filter mapping? Seems like it should be like so:
> 
>   <filter-mapping>
>     <filter-name>struts2</filter-name>
>     <url-pattern>/*</url-pattern>
>   </filter-mapping>
> 
> Regards,
> Randy Burgess
> Senior Web Applications Developer
> Nuvox Communications
> -----Original Message-----
> From: Jeromy Evans [mailto:jeromy.evans@blueskyminds.com.au] 
> Sent: Friday, January 18, 2008 4:58 AM
> To: Struts Users Mailing List
> Subject: Re: Pretty urls without .action
> 
> It should work without any other settings. Do you get an exception or 
> something else? 
> 
> It allows URLs like:
> https://kily.myseaversite.com/category
> 
> Make sure you're only testing in tomcat so you can isolate the problem.
> 
> 
> jignesh.patel wrote:
>> Hi,
>> thanks for your reply,but unfortunationatily it is not working 
>> I just want only action name without any domain like .actiion,.do,.com
>> anything (only category)
>>
>> The double comma above means "blank" is a valid extension is not able
> to
>> call respected action.
>>
>> Is there anything missing ?
>>
>>
>>
>> Jeromy Evans - Blue Sky Minds wrote:
>>   
>>> Yes, the constant "struts.action.extension" takes a comma separated
> list:
>>>
>>> eg.
>>> struts.action.extension=action,,
>>>
>>> The double comma above means "blank" is a valid extension
>>>
>>> You can add that to struts.properties, struts.xml or web.xml: 
>>> http://struts.apache.org/2.x/docs/constant-configuration.html
>>> You'll have to take care with your mod_jk mappings.
>>>
>>> jignesh(india) wrote:
>>>     
>>>> Hi,
>>>>     I am having struts2 application ready with my tomcat server.Now
> i
>>>> want
>>>> to host it with apache server,but it should be looks like pretty
> one.
>>>> I mean i want my urls without .action,.do or anything just like
> action
>>>> name
>>>> nothing more.Is this possible in struts2
>>>> e.g 
>>>> https://kily.myseaversite.com/category.action should be work like
>>>> https://kily.myseaversite.com/category
>>>>
>>>> Can anybody help me..?
>>>>
>>>> Thanks in advanced
>>>> Br,jignesh
>>>>
>>>>   
>>>>       
>>> ---------------------------------------------------------------------
>>> 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
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Pretty-urls-without-.action-tp14947106p15017135.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


RE: Pretty urls without .action

Posted by "Burgess, Randall" <RB...@nuvox.com>.
What about the filter mapping? Seems like it should be like so:

  <filter-mapping>
    <filter-name>struts2</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>

Regards,
Randy Burgess
Senior Web Applications Developer
Nuvox Communications
-----Original Message-----
From: Jeromy Evans [mailto:jeromy.evans@blueskyminds.com.au] 
Sent: Friday, January 18, 2008 4:58 AM
To: Struts Users Mailing List
Subject: Re: Pretty urls without .action

It should work without any other settings. Do you get an exception or 
something else? 

It allows URLs like:
https://kily.myseaversite.com/category

Make sure you're only testing in tomcat so you can isolate the problem.


jignesh.patel wrote:
> Hi,
> thanks for your reply,but unfortunationatily it is not working 
> I just want only action name without any domain like .actiion,.do,.com
> anything (only category)
>
> The double comma above means "blank" is a valid extension is not able
to
> call respected action.
>
> Is there anything missing ?
>
>
>
> Jeromy Evans - Blue Sky Minds wrote:
>   
>> Yes, the constant "struts.action.extension" takes a comma separated
list:
>>
>> eg.
>> struts.action.extension=action,,
>>
>> The double comma above means "blank" is a valid extension
>>
>> You can add that to struts.properties, struts.xml or web.xml: 
>> http://struts.apache.org/2.x/docs/constant-configuration.html
>> You'll have to take care with your mod_jk mappings.
>>
>> jignesh(india) wrote:
>>     
>>> Hi,
>>>     I am having struts2 application ready with my tomcat server.Now
i
>>> want
>>> to host it with apache server,but it should be looks like pretty
one.
>>> I mean i want my urls without .action,.do or anything just like
action
>>> name
>>> nothing more.Is this possible in struts2
>>> e.g 
>>> https://kily.myseaversite.com/category.action should be work like
>>> https://kily.myseaversite.com/category
>>>
>>> Can anybody help me..?
>>>
>>> Thanks in advanced
>>> Br,jignesh
>>>
>>>   
>>>       
>> ---------------------------------------------------------------------
>> 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


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


Re: Pretty urls without .action

Posted by Jeromy Evans <je...@blueskyminds.com.au>.
It should work without any other settings. Do you get an exception or 
something else? 

It allows URLs like:
https://kily.myseaversite.com/category

Make sure you're only testing in tomcat so you can isolate the problem.


jignesh.patel wrote:
> Hi,
> thanks for your reply,but unfortunationatily it is not working 
> I just want only action name without any domain like .actiion,.do,.com
> anything (only category)
>
> The double comma above means "blank" is a valid extension is not able to
> call respected action.
>
> Is there anything missing ?
>
>
>
> Jeromy Evans - Blue Sky Minds wrote:
>   
>> Yes, the constant "struts.action.extension" takes a comma separated list:
>>
>> eg.
>> struts.action.extension=action,,
>>
>> The double comma above means "blank" is a valid extension
>>
>> You can add that to struts.properties, struts.xml or web.xml: 
>> http://struts.apache.org/2.x/docs/constant-configuration.html
>> You'll have to take care with your mod_jk mappings.
>>
>> jignesh(india) wrote:
>>     
>>> Hi,
>>>     I am having struts2 application ready with my tomcat server.Now i
>>> want
>>> to host it with apache server,but it should be looks like pretty one.
>>> I mean i want my urls without .action,.do or anything just like action
>>> name
>>> nothing more.Is this possible in struts2
>>> e.g 
>>> https://kily.myseaversite.com/category.action should be work like
>>> https://kily.myseaversite.com/category
>>>
>>> Can anybody help me..?
>>>
>>> Thanks in advanced
>>> Br,jignesh
>>>
>>>   
>>>       
>> ---------------------------------------------------------------------
>> 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: Pretty urls without .action

Posted by "jignesh.patel" <ji...@aspl.in>.
Hi,
thanks for your reply,but unfortunationatily it is not working 
I just want only action name without any domain like .actiion,.do,.com
anything (only category)

The double comma above means "blank" is a valid extension is not able to
call respected action.

Is there anything missing ?



Jeromy Evans - Blue Sky Minds wrote:
> 
> Yes, the constant "struts.action.extension" takes a comma separated list:
> 
> eg.
> struts.action.extension=action,,
> 
> The double comma above means "blank" is a valid extension
> 
> You can add that to struts.properties, struts.xml or web.xml: 
> http://struts.apache.org/2.x/docs/constant-configuration.html
> You'll have to take care with your mod_jk mappings.
> 
> jignesh(india) wrote:
>> Hi,
>>     I am having struts2 application ready with my tomcat server.Now i
>> want
>> to host it with apache server,but it should be looks like pretty one.
>> I mean i want my urls without .action,.do or anything just like action
>> name
>> nothing more.Is this possible in struts2
>> e.g 
>> https://kily.myseaversite.com/category.action should be work like
>> https://kily.myseaversite.com/category
>>
>> Can anybody help me..?
>>
>> Thanks in advanced
>> Br,jignesh
>>
>>   
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Pretty-urls-without-.action-tp14947106p14948018.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: Pretty urls without .action

Posted by Jeromy Evans <je...@blueskyminds.com.au>.
Hi Jignesh,

You're right.  It doesn't work in the root namespace (only). It works in 
other namespaces. (I was testing in /test/)

The reason is that when you GET http://host:8080/email tomcat responds 
with a 302 Redirect to http://host:8080/email/
Your browser then does a GET to http://host:8080/email/ and tomcat 
returns a 404 Not Found (correctly)

I'm not sure where that behaviour originates.  I'll post separately 
about this to see if anyone else knows.

It works when change the namespace of your action like this:

<package name="ISP" extends="struts-default" namespace="/isp">

In this case, GET http://host:8080/isp/email will execute your action.

regards,
 Jeromy Evans

jignesh.patel wrote:
> Hi,
> This is my web.xml
> <web-app>
>
>     <display-name>Project Name</display-name>
>
>         <filter>
>         <filter-name>struts-cleanup</filter-name>
>        
> <filter-class>org.apache.struts2.dispatcher.ActionContextCleanUp</filter-class>
>         </filter>
>
>     <filter>
>         <filter-name>struts2</filter-name>
>        
> <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
>     </filter>
>         <filter>
>                 <filter-name>sitemesh</filter-name>
>                
> <filter-class>com.opensymphony.module.sitemesh.filter.PageFilter</filter-class>
>         </filter>
>         <filter-mapping>
>         <filter-name>struts-cleanup</filter-name>
>         <url-pattern>/*</url-pattern>
>         </filter-mapping>
>         <filter-mapping>
>         <filter-name>sitemesh</filter-name>
>         <url-pattern>/*</url-pattern>
>         </filter-mapping>
>     <filter-mapping>
>         <filter-name>struts2</filter-name>
>         <url-pattern>/*</url-pattern>
>     </filter-mapping>
>
>    <session-config>
>                 <session-timeout>60</session-timeout>
>         </session-config>
>
>     <welcome-file-list>
>         <welcome-file>ISP_View/index.html</welcome-file>
>     </welcome-file-list>
>
> </web-app>
>
> This is my sample struts.xml
> <struts>
>     <package name="ISP" extends="struts-default">
>
>                 <interceptors>
>                         <interceptor name="closeSession"
> class="isp.interceptor.CloseSessionInterceptor"/>
>
>                         <interceptor-stack name="default">
>                                         <interceptor-ref
> name="closeSession"/>
>                                         <interceptor-ref
> name="completeStack"/>
>                                         <interceptor-ref
> name="paramsPrepareParamsStack"/>
>                         </interceptor-stack>
>
>                 </interceptors>
>
>   <action name="email" class="isp.action.TempAction">
>                         <result>/XXX_View/temp.jsp</result>
>                         <result name="success">/XXX_View/temp.jsp</result>
>                         <result name="input">/XXX_View/temp.jsp</result>
>                 </action>
> </package>
> </struts>
>
> struts.properties file
>
> struts.devMode = true
> struts.enable.SlashesInActionNames=true
> struts.multipart.parser=org.apache.struts2.dispatcher.multipart.JakartaMultiPartRequest
>
>
> And url works fine with .action and .com not works only with /email or every
> action name without .action ext. ):
>
> And one more thing i am using sitemesh,but i think it not a big issue at
> all.
>
> Br,
> jignesh
>
>
>
>
>
> jignesh.patel wrote:
>   
>> Hi,
>>
>> Still not able to call without any domain name like .action,.com
>>
>> URL:- http://host:8080/email(withour . extension)
>> Error Page:-
>>
>> type Status report
>> message /email
>> description The requested resource (/email) is not available.   
>>
>> My struts.properties file
>>
>> struts.devMode = true
>> struts.enable.SlashesInActionNames=true
>> struts.multipart.parser=org.apache.struts2.dispatcher.multipart.JakartaMultiPartRequest
>> struts.action.extension=action,,com
>>
>> Have u check it with your struts application any time before..
>>
>> Plz reply
>>
>>
>>
>> Jeromy Evans - Blue Sky Minds wrote:
>>     
>>> Yes, the constant "struts.action.extension" takes a comma separated list:
>>>
>>> eg.
>>> struts.action.extension=action,,
>>>
>>> The double comma above means "blank" is a valid extension
>>>
>>> You can add that to struts.properties, struts.xml or web.xml: 
>>> http://struts.apache.org/2.x/docs/constant-configuration.html
>>> You'll have to take care with your mod_jk mappings.
>>>
>>> jignesh(india) wrote:
>>>       
>>>> Hi,
>>>>     I am having struts2 application ready with my tomcat server.Now i
>>>> want
>>>> to host it with apache server,but it should be looks like pretty one.
>>>> I mean i want my urls without .action,.do or anything just like action
>>>> name
>>>> nothing more.Is this possible in struts2
>>>> e.g 
>>>> https://kily.myseaversite.com/category.action should be work like
>>>> https://kily.myseaversite.com/category
>>>>
>>>> Can anybody help me..?
>>>>
>>>> Thanks in advanced
>>>> Br,jignesh
>>>>
>>>>   
>>>>         
>>> ---------------------------------------------------------------------
>>> 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: Pretty urls without .action

Posted by "jignesh.patel" <ji...@aspl.in>.
Hi,
This is my web.xml
<web-app>

    <display-name>Project Name</display-name>

        <filter>
        <filter-name>struts-cleanup</filter-name>
       
<filter-class>org.apache.struts2.dispatcher.ActionContextCleanUp</filter-class>
        </filter>

    <filter>
        <filter-name>struts2</filter-name>
       
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
    </filter>
        <filter>
                <filter-name>sitemesh</filter-name>
               
<filter-class>com.opensymphony.module.sitemesh.filter.PageFilter</filter-class>
        </filter>
        <filter-mapping>
        <filter-name>struts-cleanup</filter-name>
        <url-pattern>/*</url-pattern>
        </filter-mapping>
        <filter-mapping>
        <filter-name>sitemesh</filter-name>
        <url-pattern>/*</url-pattern>
        </filter-mapping>
    <filter-mapping>
        <filter-name>struts2</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

   <session-config>
                <session-timeout>60</session-timeout>
        </session-config>

    <welcome-file-list>
        <welcome-file>ISP_View/index.html</welcome-file>
    </welcome-file-list>

</web-app>

This is my sample struts.xml
<struts>
    <package name="ISP" extends="struts-default">

                <interceptors>
                        <interceptor name="closeSession"
class="isp.interceptor.CloseSessionInterceptor"/>

                        <interceptor-stack name="default">
                                        <interceptor-ref
name="closeSession"/>
                                        <interceptor-ref
name="completeStack"/>
                                        <interceptor-ref
name="paramsPrepareParamsStack"/>
                        </interceptor-stack>

                </interceptors>

  <action name="email" class="isp.action.TempAction">
                        <result>/XXX_View/temp.jsp</result>
                        <result name="success">/XXX_View/temp.jsp</result>
                        <result name="input">/XXX_View/temp.jsp</result>
                </action>
</package>
</struts>

struts.properties file

struts.devMode = true
struts.enable.SlashesInActionNames=true
struts.multipart.parser=org.apache.struts2.dispatcher.multipart.JakartaMultiPartRequest


And url works fine with .action and .com not works only with /email or every
action name without .action ext. ):

And one more thing i am using sitemesh,but i think it not a big issue at
all.

Br,
jignesh





jignesh.patel wrote:
> 
> Hi,
> 
> Still not able to call without any domain name like .action,.com
> 
> URL:- http://host:8080/email(withour . extension)
> Error Page:-
> 
> type Status report
> message /email
> description The requested resource (/email) is not available.   
> 
> My struts.properties file
> 
> struts.devMode = true
> struts.enable.SlashesInActionNames=true
> struts.multipart.parser=org.apache.struts2.dispatcher.multipart.JakartaMultiPartRequest
> struts.action.extension=action,,com
> 
> Have u check it with your struts application any time before..
> 
> Plz reply
> 
> 
> 
> Jeromy Evans - Blue Sky Minds wrote:
>> 
>> Yes, the constant "struts.action.extension" takes a comma separated list:
>> 
>> eg.
>> struts.action.extension=action,,
>> 
>> The double comma above means "blank" is a valid extension
>> 
>> You can add that to struts.properties, struts.xml or web.xml: 
>> http://struts.apache.org/2.x/docs/constant-configuration.html
>> You'll have to take care with your mod_jk mappings.
>> 
>> jignesh(india) wrote:
>>> Hi,
>>>     I am having struts2 application ready with my tomcat server.Now i
>>> want
>>> to host it with apache server,but it should be looks like pretty one.
>>> I mean i want my urls without .action,.do or anything just like action
>>> name
>>> nothing more.Is this possible in struts2
>>> e.g 
>>> https://kily.myseaversite.com/category.action should be work like
>>> https://kily.myseaversite.com/category
>>>
>>> Can anybody help me..?
>>>
>>> Thanks in advanced
>>> Br,jignesh
>>>
>>>   
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Pretty-urls-without-.action-tp14947106p14997182.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: Pretty urls without .action

Posted by Jeromy Evans <je...@blueskyminds.com.au>.
Hi,

Yes, I'm 100% certain this option allows struts to use a blank and/or 
alternative extensions. 
I just tried "action,,com" myself and it works loading my 
"/test/test.action, /test/test.com and "/test/test". 

Did /email.action work?  Did /email.com work?
Do you have the mentioned filter mapping in web.xml?  (/*)
Did the struts2 filter actually start?
Is struts.properties deployed in the correct location? (WEB-INF/classes/)
Have you tested from localhost?

It's unusual that you have "struts.enable.SlashesInActionNames=true" but 
I've confirmed that doesn't affect this URL either.  I'm using struts 
2.1 but I'm certain this is a 2.0 feature.

Hope that helps isolate the problem
regards,
Jeromy Evans

jignesh.patel wrote:
> Hi,
>
> Still not able to call without any domain name like .action,.com
>
> URL:- http://host:8080/email(withour . extension)
> Error Page:-
>
> type Status report
> message /email
> description The requested resource (/email) is not available.   
>
> My struts.properties file
>
> struts.devMode = true
> struts.enable.SlashesInActionNames=true
> struts.multipart.parser=org.apache.struts2.dispatcher.multipart.JakartaMultiPartRequest
> struts.action.extension=action,,com
>
> Have u check it with your struts application any time before..
>
> Plz reply
>
>
>
> Jeromy Evans - Blue Sky Minds wrote:
>   
>> Yes, the constant "struts.action.extension" takes a comma separated list:
>>
>> eg.
>> struts.action.extension=action,,
>>
>> The double comma above means "blank" is a valid extension
>>
>> You can add that to struts.properties, struts.xml or web.xml: 
>> http://struts.apache.org/2.x/docs/constant-configuration.html
>> You'll have to take care with your mod_jk mappings.
>>
>> jignesh(india) wrote:
>>     
>>> Hi,
>>>     I am having struts2 application ready with my tomcat server.Now i
>>> want
>>> to host it with apache server,but it should be looks like pretty one.
>>> I mean i want my urls without .action,.do or anything just like action
>>> name
>>> nothing more.Is this possible in struts2
>>> e.g 
>>> https://kily.myseaversite.com/category.action should be work like
>>> https://kily.myseaversite.com/category
>>>
>>> Can anybody help me..?
>>>
>>> Thanks in advanced
>>> Br,jignesh
>>>
>>>   
>>>       
>> ---------------------------------------------------------------------
>> 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: Pretty urls without .action

Posted by "jignesh.patel" <ji...@aspl.in>.
Hi,

Still not able to call without any domain name like .action,.com

URL:- http://host:8080/email(withour . extension)
Error Page:-

type Status report
message /email
description The requested resource (/email) is not available.   

My struts.properties file

struts.devMode = true
struts.enable.SlashesInActionNames=true
struts.multipart.parser=org.apache.struts2.dispatcher.multipart.JakartaMultiPartRequest
struts.action.extension=action,,com

Have u check it with your struts application any time before..

Plz reply



Jeromy Evans - Blue Sky Minds wrote:
> 
> Yes, the constant "struts.action.extension" takes a comma separated list:
> 
> eg.
> struts.action.extension=action,,
> 
> The double comma above means "blank" is a valid extension
> 
> You can add that to struts.properties, struts.xml or web.xml: 
> http://struts.apache.org/2.x/docs/constant-configuration.html
> You'll have to take care with your mod_jk mappings.
> 
> jignesh(india) wrote:
>> Hi,
>>     I am having struts2 application ready with my tomcat server.Now i
>> want
>> to host it with apache server,but it should be looks like pretty one.
>> I mean i want my urls without .action,.do or anything just like action
>> name
>> nothing more.Is this possible in struts2
>> e.g 
>> https://kily.myseaversite.com/category.action should be work like
>> https://kily.myseaversite.com/category
>>
>> Can anybody help me..?
>>
>> Thanks in advanced
>> Br,jignesh
>>
>>   
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Pretty-urls-without-.action-tp14947106p14992044.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: Pretty urls without .action

Posted by Jeromy Evans <je...@blueskyminds.com.au>.
Yes, the constant "struts.action.extension" takes a comma separated list:

eg.
struts.action.extension=action,,

The double comma above means "blank" is a valid extension

You can add that to struts.properties, struts.xml or web.xml: 
http://struts.apache.org/2.x/docs/constant-configuration.html
You'll have to take care with your mod_jk mappings.

jignesh(india) wrote:
> Hi,
>     I am having struts2 application ready with my tomcat server.Now i want
> to host it with apache server,but it should be looks like pretty one.
> I mean i want my urls without .action,.do or anything just like action name
> nothing more.Is this possible in struts2
> e.g 
> https://kily.myseaversite.com/category.action should be work like
> https://kily.myseaversite.com/category
>
> Can anybody help me..?
>
> Thanks in advanced
> Br,jignesh
>
>   


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