You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by meeboo <de...@gmail.com> on 2007/04/09 18:21:48 UTC

struts.action.extension question


-- 
View this message in context: http://www.nabble.com/struts.action.extension-question-tf3548145.html#a9905001
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: struts.action.extension question

Posted by "Fogleson, Allen" <al...@daugherty.com>.
Are you fronting with Apache? What we normally do if we are fronting with apache is serve all the static content from there (of course) so it never gets to the app server to cause this kind of confusion there. A simple JkUnmount /movie/*.css workerName will do it for Apache-Tomcat (or Apache-jboss for that matter)
 
Al
 
>Unfortunately I'm running Tomcat. I did come up with a pretty clean solution
>though, what I do is that I link to the CSS /JS/Image files via an absolute
>URL, so instead of "public/css/design.css" I use
>"http://mydomain.com/public/css/design.css" - good enough for me at the
>moment.



RE: struts.action.extension question

Posted by "Fogleson, Allen" <al...@daugherty.com>.
Hmm Yes... What is the problem then? I don't think I understand it now either.
 
Al
 
>I believe I didn't follow the original issue, then.
>
>I thought that struts2 was swallowing the requests for the css files because
>they fit the pattern specified by the filter.
>I can't see how making them absolute urls would be any different for the
>filter, because when the request is made by the browser, it all looks the
>same to the filter.




Re: struts.action.extension question

Posted by cilquirm <aa...@gmail.com>.

I believe I didn't follow the original issue, then.

I thought that struts2 was swallowing the requests for the css files because
they fit the pattern specified by the filter.
I can't see how making them absolute urls would be any different for the
filter, because when the request is made by the browser, it all looks the
same to the filter.


meeboo wrote:
> 
> Unfortunately I'm running Tomcat. I did come up with a pretty clean
> solution though, what I do is that I link to the CSS /JS/Image files via
> an absolute URL, so instead of "public/css/design.css" I use
> "http://mydomain.com/public/css/design.css" - good enough for me at the
> moment.
> 
> 
> cilquirm wrote:
>> 
>> I don't believe this can be cleanly handled with just the web 2.4 spec
>> and struts2.
>> 
>> Some container, like Resin, allow for url-patterns to be regexes, which
>> would help in this scenario.
>> 
>> 
>> 
>> meeboo wrote:
>>> 
>>> The problem is that I have a lot of URL:s which look like
>>> /user/username, movie/movieTitle or account/create - and I don't want to
>>> forward or redirect for each URL since this will slow down my
>>> application. Is there a way to exclude .css extensions maybe?
>>> 
>>> 
>>> joey-30 wrote:
>>>> 
>>>> keep struts.action.extension default.and create a filter to make sure
>>>> it's before the struts filter.like this:
>>>>     <filter-mapping>
>>>>         <filter-name>yourfilter</filter-name>
>>>>         <url-pattern>movie/*</url-pattern>
>>>>     </filter-mapping>
>>>>     <filter-mapping>
>>>>         <filter-name>struts2</filter-name>
>>>>         <url-pattern>/*</url-pattern>
>>>>     </filter-mapping>
>>>> u can foward or redirect to the url movie.action?movieTitle=* or
>>>> something
>>>> else in your
>>>> filter.
>>>> 
>>>> regards
>>>> joey
>>>> On 4/11/07, meeboo <de...@gmail.com> wrote:
>>>>>
>>>>>
>>>>> No takers on this?
>>>>>
>>>>>
>>>>> meeboo wrote:
>>>>> >
>>>>> > Hey all
>>>>> >
>>>>> > I have a mapping pattern which looks like this
>>>>> >
>>>>> > <action name="movie/*"
>>>>> class="com.bubbleclip.web.struts.action.PlayMovie
>>>>> ">
>>>>> >             <param name="movieTitle">{1}</param>
>>>>> >             <result>/movie.jsp</result>
>>>>> > </action>
>>>>> >
>>>>> > The wildcard is for backwards compability since our original
>>>>> JSP/Servlet
>>>>> > web-layer mapped movie titles like
>>>>> > http:localhost:8080/movie/movieTitle
>>>>> >
>>>>> > This works fine if I set struts.action.extension to "", this way I
>>>>> > preserve compatibility since the movie title is the actual action
>>>>> name.
>>>>> > The problem is that S2 will also interpret everything else as being
>>>>> > actions - even CSS names making the pages not render correctly. Is
>>>>> there
>>>>> a
>>>>> > way around this?
>>>>> >
>>>>>
>>>>> --
>>>>> View this message in context:
>>>>> http://www.nabble.com/struts.action.extension-question-tf3548145.html#a9934814
>>>>> 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
>>>>>
>>>>>
>>>> 
>>>> 
>>> 
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/struts.action.extension-question-tf3548145.html#a9946608
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: struts.action.extension question

Posted by meeboo <de...@gmail.com>.
Unfortunately I'm running Tomcat. I did come up with a pretty clean solution
though, what I do is that I link to the CSS /JS/Image files via an absolute
URL, so instead of "public/css/design.css" I use
"http://mydomain.com/public/css/design.css" - good enough for me at the
moment.


cilquirm wrote:
> 
> I don't believe this can be cleanly handled with just the web 2.4 spec and
> struts2.
> 
> Some container, like Resin, allow for url-patterns to be regexes, which
> would help in this scenario.
> 
> 
> 
> meeboo wrote:
>> 
>> The problem is that I have a lot of URL:s which look like /user/username,
>> movie/movieTitle or account/create - and I don't want to forward or
>> redirect for each URL since this will slow down my application. Is there
>> a way to exclude .css extensions maybe?
>> 
>> 
>> joey-30 wrote:
>>> 
>>> keep struts.action.extension default.and create a filter to make sure
>>> it's before the struts filter.like this:
>>>     <filter-mapping>
>>>         <filter-name>yourfilter</filter-name>
>>>         <url-pattern>movie/*</url-pattern>
>>>     </filter-mapping>
>>>     <filter-mapping>
>>>         <filter-name>struts2</filter-name>
>>>         <url-pattern>/*</url-pattern>
>>>     </filter-mapping>
>>> u can foward or redirect to the url movie.action?movieTitle=* or
>>> something
>>> else in your
>>> filter.
>>> 
>>> regards
>>> joey
>>> On 4/11/07, meeboo <de...@gmail.com> wrote:
>>>>
>>>>
>>>> No takers on this?
>>>>
>>>>
>>>> meeboo wrote:
>>>> >
>>>> > Hey all
>>>> >
>>>> > I have a mapping pattern which looks like this
>>>> >
>>>> > <action name="movie/*"
>>>> class="com.bubbleclip.web.struts.action.PlayMovie
>>>> ">
>>>> >             <param name="movieTitle">{1}</param>
>>>> >             <result>/movie.jsp</result>
>>>> > </action>
>>>> >
>>>> > The wildcard is for backwards compability since our original
>>>> JSP/Servlet
>>>> > web-layer mapped movie titles like
>>>> > http:localhost:8080/movie/movieTitle
>>>> >
>>>> > This works fine if I set struts.action.extension to "", this way I
>>>> > preserve compatibility since the movie title is the actual action
>>>> name.
>>>> > The problem is that S2 will also interpret everything else as being
>>>> > actions - even CSS names making the pages not render correctly. Is
>>>> there
>>>> a
>>>> > way around this?
>>>> >
>>>>
>>>> --
>>>> View this message in context:
>>>> http://www.nabble.com/struts.action.extension-question-tf3548145.html#a9934814
>>>> 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
>>>>
>>>>
>>> 
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/struts.action.extension-question-tf3548145.html#a9946297
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


Show error in parent page

Posted by Francisco Exposito Aguilera <fc...@hotmail.com>.
Hi all,

I have a jsp with a download button. When I click on that button, a new web 
page using javascript is opened:

<html:submit property="accion" styleClass="boton" 
onclick="window.open('http://server:8080/FileServer/Menus/Search/selectDownloadType.jsp','blank','width=400,height=300,scrollbars=no')"><fmt:message 
key="button.download"/></html:submit>

<html:messages id="msg" message="true">
   <bean:write name="msg"/><br>
</html:messages>

In the new web page I only have this code:

<html:form action="modificarAsociacion.do">
<input type="hidden" name="rPropietario" value="<bean:write 
name="propietarioAsociacion" property="dni"/>"/>
<input type="hidden" name="idAsociacion" value="<bean:write 
name="asociacionActiva" property="idAsociacion"/>"/>
<input type="radio" name="tipoDescarga" value="porVersion">Versión más alta
<input type="radio" name="tipoDescarga" value="porEstado">Estado más 
alto</td>
<html:submit property="accion" styleClass="boton"><fmt:message 
key="boton.downloadFile"/></html:submit>
</html:form>

If the logged user has permission to download the file, it works properly, 
but if he doesn't have permissions, the error is not shown in the parent web 
page; the parent page is opened inside the child page showing the error.

Is there any way to show the error in the parent page?

Thanks a lot.

Best regards,
Paco

_________________________________________________________________
Descarga gratis la Barra de Herramientas de MSN 
http://www.msn.es/usuario/busqueda/barra?XAPID=2031&DI=1055&SU=http%3A//www.hotmail.com&HL=LINKTAG1OPENINGTEXT_MSNBH


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


Re: struts.action.extension question

Posted by cilquirm <aa...@gmail.com>.
I don't believe this can be cleanly handled with just the web 2.4 spec and
struts2.

Some container, like Resin, allow for url-patterns to be regexes, which
would help in this scenario.



meeboo wrote:
> 
> The problem is that I have a lot of URL:s which look like /user/username,
> movie/movieTitle or account/create - and I don't want to forward or
> redirect for each URL since this will slow down my application. Is there a
> way to exclude .css extensions maybe?
> 
> 
> joey-30 wrote:
>> 
>> keep struts.action.extension default.and create a filter to make sure
>> it's before the struts filter.like this:
>>     <filter-mapping>
>>         <filter-name>yourfilter</filter-name>
>>         <url-pattern>movie/*</url-pattern>
>>     </filter-mapping>
>>     <filter-mapping>
>>         <filter-name>struts2</filter-name>
>>         <url-pattern>/*</url-pattern>
>>     </filter-mapping>
>> u can foward or redirect to the url movie.action?movieTitle=* or
>> something
>> else in your
>> filter.
>> 
>> regards
>> joey
>> On 4/11/07, meeboo <de...@gmail.com> wrote:
>>>
>>>
>>> No takers on this?
>>>
>>>
>>> meeboo wrote:
>>> >
>>> > Hey all
>>> >
>>> > I have a mapping pattern which looks like this
>>> >
>>> > <action name="movie/*"
>>> class="com.bubbleclip.web.struts.action.PlayMovie
>>> ">
>>> >             <param name="movieTitle">{1}</param>
>>> >             <result>/movie.jsp</result>
>>> > </action>
>>> >
>>> > The wildcard is for backwards compability since our original
>>> JSP/Servlet
>>> > web-layer mapped movie titles like
>>> > http:localhost:8080/movie/movieTitle
>>> >
>>> > This works fine if I set struts.action.extension to "", this way I
>>> > preserve compatibility since the movie title is the actual action
>>> name.
>>> > The problem is that S2 will also interpret everything else as being
>>> > actions - even CSS names making the pages not render correctly. Is
>>> there
>>> a
>>> > way around this?
>>> >
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/struts.action.extension-question-tf3548145.html#a9934814
>>> 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
>>>
>>>
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/struts.action.extension-question-tf3548145.html#a9941787
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: struts.action.extension question

Posted by meeboo <de...@gmail.com>.
The problem is that I have a lot of URL:s which look like /user/username,
movie/movieTitle or account/create - and I don't want to forward or redirect
for each URL since this will slow down my application. Is there a way to
exclude .css extensions maybe?


joey-30 wrote:
> 
> keep struts.action.extension default.and create a filter to make sure
> it's before the struts filter.like this:
>     <filter-mapping>
>         <filter-name>yourfilter</filter-name>
>         <url-pattern>movie/*</url-pattern>
>     </filter-mapping>
>     <filter-mapping>
>         <filter-name>struts2</filter-name>
>         <url-pattern>/*</url-pattern>
>     </filter-mapping>
> u can foward or redirect to the url movie.action?movieTitle=* or something
> else in your
> filter.
> 
> regards
> joey
> On 4/11/07, meeboo <de...@gmail.com> wrote:
>>
>>
>> No takers on this?
>>
>>
>> meeboo wrote:
>> >
>> > Hey all
>> >
>> > I have a mapping pattern which looks like this
>> >
>> > <action name="movie/*"
>> class="com.bubbleclip.web.struts.action.PlayMovie
>> ">
>> >             <param name="movieTitle">{1}</param>
>> >             <result>/movie.jsp</result>
>> > </action>
>> >
>> > The wildcard is for backwards compability since our original
>> JSP/Servlet
>> > web-layer mapped movie titles like
>> > http:localhost:8080/movie/movieTitle
>> >
>> > This works fine if I set struts.action.extension to "", this way I
>> > preserve compatibility since the movie title is the actual action name.
>> > The problem is that S2 will also interpret everything else as being
>> > actions - even CSS names making the pages not render correctly. Is
>> there
>> a
>> > way around this?
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/struts.action.extension-question-tf3548145.html#a9934814
>> 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
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/struts.action.extension-question-tf3548145.html#a9936131
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: struts.action.extension question

Posted by joey <re...@gmail.com>.
keep struts.action.extension default.and create a filter to make sure
it's before the struts filter.like this:
    <filter-mapping>
        <filter-name>yourfilter</filter-name>
        <url-pattern>movie/*</url-pattern>
    </filter-mapping>
    <filter-mapping>
        <filter-name>struts2</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
u can foward or redirect to the url movie.action?movieTitle=* or something
else in your
filter.

regards
joey
On 4/11/07, meeboo <de...@gmail.com> wrote:
>
>
> No takers on this?
>
>
> meeboo wrote:
> >
> > Hey all
> >
> > I have a mapping pattern which looks like this
> >
> > <action name="movie/*" class="com.bubbleclip.web.struts.action.PlayMovie
> ">
> >             <param name="movieTitle">{1}</param>
> >             <result>/movie.jsp</result>
> > </action>
> >
> > The wildcard is for backwards compability since our original JSP/Servlet
> > web-layer mapped movie titles like
> > http:localhost:8080/movie/movieTitle
> >
> > This works fine if I set struts.action.extension to "", this way I
> > preserve compatibility since the movie title is the actual action name.
> > The problem is that S2 will also interpret everything else as being
> > actions - even CSS names making the pages not render correctly. Is there
> a
> > way around this?
> >
>
> --
> View this message in context:
> http://www.nabble.com/struts.action.extension-question-tf3548145.html#a9934814
> 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: struts.action.extension question

Posted by meeboo <de...@gmail.com>.
No takers on this?


meeboo wrote:
> 
> Hey all
> 
> I have a mapping pattern which looks like this
> 
> <action name="movie/*" class="com.bubbleclip.web.struts.action.PlayMovie">
>             <param name="movieTitle">{1}</param>
>             <result>/movie.jsp</result>
> </action>
> 
> The wildcard is for backwards compability since our original JSP/Servlet
> web-layer mapped movie titles like 
> http:localhost:8080/movie/movieTitle
> 
> This works fine if I set struts.action.extension to "", this way I
> preserve compatibility since the movie title is the actual action name.
> The problem is that S2 will also interpret everything else as being
> actions - even CSS names making the pages not render correctly. Is there a
> way around this?
> 

-- 
View this message in context: http://www.nabble.com/struts.action.extension-question-tf3548145.html#a9934814
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