You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by albert kao <al...@gmail.com> on 2019/11/15 13:13:06 UTC

s:property #attr working in header.jsp but not HTTP 404.jsp

This line displays the proper value
   <script src="<s:property value="#attr.url"/>"></script>
in header.jsp:
   <script src="/js/myscript"/>"></script>

but displays an empty string
in http404.jsp ("Page Not Found"):
   <script src=""/>"></script>

Please help.
Thanks.

Re: s:property #attr working in header.jsp but not HTTP 404.jsp

Posted by Lukasz Lenart <lu...@apache.org>.
pt., 15 lis 2019 o 16:06 albert kao <al...@gmail.com> napisał(a):
>
> How to fix it?
> I like to use a variable instead of hard coding like this:
> <script src="/js/myscript"/>"></script>

It isn't about JavaScript, but how do you redirect/forward to such JSP
page? You should define a global action `404.action` and use it
instead of the JSP


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

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


Re: s:property #attr working in header.jsp but not HTTP 404.jsp

Posted by albert kao <al...@gmail.com>.
How to fix it?
I like to use a variable instead of hard coding like this:
<script src="/js/myscript"/>"></script>

On Fri, Nov 15, 2019 at 8:24 AM Lukasz Lenart <lu...@apache.org>
wrote:

> pt., 15 lis 2019 o 14:13 albert kao <al...@gmail.com> napisał(a):
> > but displays an empty string
> > in http404.jsp ("Page Not Found"):
> >    <script src=""/>"></script>
>
> How do you access the http404.jsp? Directly, out of action? If so,
> there is no context that's why #attr doesn't work
>
>
> Regards
> --
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: s:property #attr working in header.jsp but not HTTP 404.jsp

Posted by Lukasz Lenart <lu...@apache.org>.
pt., 15 lis 2019 o 14:13 albert kao <al...@gmail.com> napisał(a):
> but displays an empty string
> in http404.jsp ("Page Not Found"):
>    <script src=""/>"></script>

How do you access the http404.jsp? Directly, out of action? If so,
there is no context that's why #attr doesn't work


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

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