Re: strange behavior of s:a tag with s:include tag inside

2011-07-05 Thread Łukasz Lenart
Added for review
https://reviews.apache.org/r/1003/


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/
Warszawa JUG conference - Confitura http://confitura.pl/

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



Re: strange behavior of s:a tag with s:include tag inside

2011-07-03 Thread Łukasz Lenart
I don't know why it happens that way. I've changed a bit templates by
moving some code from a-close.ftl to a.ftl and now it works as you've
been expecting. But that change broken few tests and can be backward
incompatible.


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/
Warszawa JUG conference - Confitura http://confitura.pl/


2011/7/1 Александр Высоков nod...@gmail.com:
 Do you mean
 s:url action=test2 var=ac/
 s:include value=%{ac}/
 ?

 Tried. Empty body of a tag.


 2 июля 2011 г. 0:56 пользователь Dave Newton davelnew...@gmail.comнаписал:

 2011/7/1 Александр Высоков nod...@gmail.com:
  Dave, if I expressed roughly, I am very sorry (my bad english is not good
 enough).

 Nope, you're doing great :)

 Try using a link to an action in the s:include tag instead of a plain
 JSP.

 For now you could just create a class-less action mapping that
 forwards to the JSP you're currently using. See if the behavior
 continues.

 Dave

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




 --
 С уважением, Александр.


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



Re: strange behavior of s:a tag with s:include tag inside

2011-07-03 Thread Maurizio Cucchiara
Hi Lukasz,
could you share your patch through JIRA (there was an open ticket IIRC)?

2011/7/3 Łukasz Lenart lukasz.len...@googlemail.com

 I don't know why it happens that way. I've changed a bit templates by
 moving some code from a-close.ftl to a.ftl and now it works as you've
 been expecting. But that change broken few tests and can be backward
 incompatible.


 Regards
 --
 Łukasz
 + 48 606 323 122 http://www.lenart.org.pl/
 Warszawa JUG conference - Confitura http://confitura.pl/


 2011/7/1 Александр Высоков nod...@gmail.com:
  Do you mean
  s:url action=test2 var=ac/
  s:include value=%{ac}/
  ?
 
  Tried. Empty body of a tag.
 
 
  2 июля 2011 г. 0:56 пользователь Dave Newton davelnew...@gmail.com
 написал:
 
  2011/7/1 Александр Высоков nod...@gmail.com:
   Dave, if I expressed roughly, I am very sorry (my bad english is not
 good
  enough).
 
  Nope, you're doing great :)
 
  Try using a link to an action in the s:include tag instead of a plain
  JSP.
 
  For now you could just create a class-less action mapping that
  forwards to the JSP you're currently using. See if the behavior
  continues.
 
  Dave
 
  -
  To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
  For additional commands, e-mail: user-h...@struts.apache.org
 
 
 
 
  --
  С уважением, Александр.
 

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




-- 
Maurizio Cucchiara


Re: strange behavior of s:a tag with s:include tag inside

2011-07-03 Thread Łukasz Lenart
Done!

https://issues.apache.org/jira/browse/WW-3659

2011/7/3 Maurizio Cucchiara maurizio.cucchi...@gmail.com:
 Hi Lukasz,
 could you share your patch through JIRA (there was an open ticket IIRC)?

 2011/7/3 Łukasz Lenart lukasz.len...@googlemail.com

 I don't know why it happens that way. I've changed a bit templates by
 moving some code from a-close.ftl to a.ftl and now it works as you've
 been expecting. But that change broken few tests and can be backward
 incompatible.


 Regards
 --
 Łukasz
 + 48 606 323 122 http://www.lenart.org.pl/
 Warszawa JUG conference - Confitura http://confitura.pl/


 2011/7/1 Александр Высоков nod...@gmail.com:
  Do you mean
  s:url action=test2 var=ac/
  s:include value=%{ac}/
  ?
 
  Tried. Empty body of a tag.
 
 
  2 июля 2011 г. 0:56 пользователь Dave Newton
  davelnew...@gmail.comнаписал:
 
  2011/7/1 Александр Высоков nod...@gmail.com:
   Dave, if I expressed roughly, I am very sorry (my bad english is not
   good
  enough).
 
  Nope, you're doing great :)
 
  Try using a link to an action in the s:include tag instead of a plain
  JSP.
 
  For now you could just create a class-less action mapping that
  forwards to the JSP you're currently using. See if the behavior
  continues.
 
  Dave
 
  -
  To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
  For additional commands, e-mail: user-h...@struts.apache.org
 
 
 
 
  --
  С уважением, Александр.
 

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




 --
 Maurizio Cucchiara


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



strange behavior of s:a tag with s:include tag inside

2011-07-01 Thread Александр Высоков
Hello all.

I have two files.

test.jsp

%@ page language=java contentType=text/html; charset=UTF-8
pageEncoding=UTF-8%
%@ taglib uri=/struts-tags prefix=s %
s:set name=depId value=1 scope=page/
s:a id=%{#attr.depId}
href=javascript:some-javascript-method('%{#attr.depId}')
s:include value=test2.jsp/
/s:a

test2.jsp
-
%@ page language=java contentType=text/html; charset=UTF-8
pageEncoding=UTF-8%
%@ taglib uri=/struts-tags prefix=s %
s:set name=test value=1 scope=page/
1

The result of call http://localhost:8080/myapp/test.jsp is:
a id=1 href=javascript:some-javascript-method('')1/a

as we can see, second evaluation of %{#attr.depId} is missing (must be
javascript:some-javascript-method('1')). I cannot understand why it
happens.
But when I remove line s:set name=test value=1 scope=page/ from
test2.jsp file and call again I receive correct result:
a id=1 href=javascript:some-javascript-method('1')1/a

Is this a bug or I do not understand something in Struts2?


Re: strange behavior of s:a tag with s:include tag inside

2011-07-01 Thread Dave Newton
Unless the JSP is processed through an action, the original comment in the
jira ticket is correct.

Recall that a filter can stop processing a request, which is what happens if
it's not a request that hits an action.

Dave
 On Jul 1, 2011 8:59 AM, Александр Высоков nod...@gmail.com wrote:
 Hello all.

 I have two files.

 test.jsp
 
 %@ page language=java contentType=text/html; charset=UTF-8
 pageEncoding=UTF-8%
 %@ taglib uri=/struts-tags prefix=s %
 s:set name=depId value=1 scope=page/
 s:a id=%{#attr.depId}
 href=javascript:some-javascript-method('%{#attr.depId}')
 s:include value=test2.jsp/
 /s:a

 test2.jsp
 -
 %@ page language=java contentType=text/html; charset=UTF-8
 pageEncoding=UTF-8%
 %@ taglib uri=/struts-tags prefix=s %
 s:set name=test value=1 scope=page/
 1

 The result of call http://localhost:8080/myapp/test.jsp is:
 a id=1 href=javascript:some-javascript-method('')1/a

 as we can see, second evaluation of %{#attr.depId} is missing (must be
 javascript:some-javascript-method('1')). I cannot understand why it
 happens.
 But when I remove line s:set name=test value=1 scope=page/ from
 test2.jsp file and call again I receive correct result:
 a id=1 href=javascript:some-javascript-method('1')1/a

 Is this a bug or I do not understand something in Struts2?


Re: strange behavior of s:a tag with s:include tag inside

2011-07-01 Thread Александр Высоков
I've created test project (attached StrutsBugTest.war) in jira. In that
project you can click to the link in index.html and see the same strange
behavior.

1 июля 2011 г. 17:28 пользователь Dave Newton davelnew...@gmail.comнаписал:

 Unless the JSP is processed through an action, the original comment in the
 jira ticket is correct.

 Recall that a filter can stop processing a request, which is what happens
 if
 it's not a request that hits an action.

 Dave
  On Jul 1, 2011 8:59 AM, Александр Высоков nod...@gmail.com wrote:
  Hello all.
 
  I have two files.
 
  test.jsp
  
  %@ page language=java contentType=text/html; charset=UTF-8
  pageEncoding=UTF-8%
  %@ taglib uri=/struts-tags prefix=s %
  s:set name=depId value=1 scope=page/
  s:a id=%{#attr.depId}
  href=javascript:some-javascript-method('%{#attr.depId}')
  s:include value=test2.jsp/
  /s:a
 
  test2.jsp
  -
  %@ page language=java contentType=text/html; charset=UTF-8
  pageEncoding=UTF-8%
  %@ taglib uri=/struts-tags prefix=s %
  s:set name=test value=1 scope=page/
  1
 
  The result of call http://localhost:8080/myapp/test.jsp is:
  a id=1 href=javascript:some-javascript-method('')1/a
 
  as we can see, second evaluation of %{#attr.depId} is missing (must be
  javascript:some-javascript-method('1')). I cannot understand why it
  happens.
  But when I remove line s:set name=test value=1 scope=page/ from
  test2.jsp file and call again I receive correct result:
  a id=1 href=javascript:some-javascript-method('1')1/a
 
  Is this a bug or I do not understand something in Struts2?




-- 
С уважением, Александр.


RE: strange behavior of s:a tag with s:include tag inside

2011-07-01 Thread Martin Gainty

Set.html:
String name Deprecated. Use 'var' insteadchange attribute name=depId
   to var=depId

Martin 
__ 
Verzicht und Vertraulichkeitanmerkung
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger 
sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem 
Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. 
Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung 
fuer den Inhalt uebernehmen.




 Date: Fri, 1 Jul 2011 18:30:22 +0400
 Subject: Re: strange behavior of s:a tag with s:include tag inside
 From: nod...@gmail.com
 To: user@struts.apache.org
 
 I've created test project (attached StrutsBugTest.war) in jira. In that
 project you can click to the link in index.html and see the same strange
 behavior.
 
 1 июля 2011 г. 17:28 пользователь Dave Newton davelnew...@gmail.comнаписал:
 
  Unless the JSP is processed through an action, the original comment in the
  jira ticket is correct.
 
  Recall that a filter can stop processing a request, which is what happens
  if
  it's not a request that hits an action.
 
  Dave
   On Jul 1, 2011 8:59 AM, Александр Высоков nod...@gmail.com wrote:
   Hello all.
  
   I have two files.
  
   test.jsp
   
   %@ page language=java contentType=text/html; charset=UTF-8
   pageEncoding=UTF-8%
   %@ taglib uri=/struts-tags prefix=s %
   s:set name=depId value=1 scope=page/
   s:a id=%{#attr.depId}
   href=javascript:some-javascript-method('%{#attr.depId}')
   s:include value=test2.jsp/
   /s:a
  
   test2.jsp
   -
   %@ page language=java contentType=text/html; charset=UTF-8
   pageEncoding=UTF-8%
   %@ taglib uri=/struts-tags prefix=s %
   s:set name=test value=1 scope=page/
   1
  
   The result of call http://localhost:8080/myapp/test.jsp is:
   a id=1 href=javascript:some-javascript-method('')1/a
  
   as we can see, second evaluation of %{#attr.depId} is missing (must be
   javascript:some-javascript-method('1')). I cannot understand why it
   happens.
   But when I remove line s:set name=test value=1 scope=page/ from
   test2.jsp file and call again I receive correct result:
   a id=1 href=javascript:some-javascript-method('1')1/a
  
   Is this a bug or I do not understand something in Struts2?
 
 
 
 
 -- 
 С уважением, Александр.
  

Re: strange behavior of s:a tag with s:include tag inside

2011-07-01 Thread Maurizio Cucchiara
As I said before, don't call jsp directly via browser: rather you need to
invoke a struts action that, after looked at your action mapping
configuration, forward the request to your final jsp

Maurizio Cucchiara

Il giorno 01/lug/2011 16.30, Александр Высоков nod...@gmail.com ha
scritto:
 I've created test project (attached StrutsBugTest.war) in jira. In that
 project you can click to the link in index.html and see the same strange
 behavior.

 1 июля 2011 г. 17:28 пользователь Dave Newton davelnew...@gmail.com
написал:

 Unless the JSP is processed through an action, the original comment in
the
 jira ticket is correct.

 Recall that a filter can stop processing a request, which is what happens
 if
 it's not a request that hits an action.

 Dave
 On Jul 1, 2011 8:59 AM, Александр Высоков nod...@gmail.com wrote:
  Hello all.
 
  I have two files.
 
  test.jsp
  
  %@ page language=java contentType=text/html; charset=UTF-8
  pageEncoding=UTF-8%
  %@ taglib uri=/struts-tags prefix=s %
  s:set name=depId value=1 scope=page/
  s:a id=%{#attr.depId}
  href=javascript:some-javascript-method('%{#attr.depId}')
  s:include value=test2.jsp/
  /s:a
 
  test2.jsp
  -
  %@ page language=java contentType=text/html; charset=UTF-8
  pageEncoding=UTF-8%
  %@ taglib uri=/struts-tags prefix=s %
  s:set name=test value=1 scope=page/
  1
 
  The result of call http://localhost:8080/myapp/test.jsp is:
  a id=1 href=javascript:some-javascript-method('')1/a
 
  as we can see, second evaluation of %{#attr.depId} is missing (must be
  javascript:some-javascript-method('1')). I cannot understand why it
  happens.
  But when I remove line s:set name=test value=1 scope=page/ from
  test2.jsp file and call again I receive correct result:
  a id=1 href=javascript:some-javascript-method('1')1/a
 
  Is this a bug or I do not understand something in Struts2?




 --
 С уважением, Александр.


strange behavior of s:a tag with s:include tag inside

2011-07-01 Thread Александр Высоков
Hello all.

I have two files.

test.jsp

%@ page language=java contentType=text/html; charset=UTF-8
pageEncoding=UTF-8%
%@ taglib uri=/struts-tags prefix=s %
s:set name=depId value=1 scope=page/
s:a id=%{#attr.depId}
href=javascript:some-javascript-method('%{#attr.depId}')
s:include value=test2.jsp/
/s:a

test2.jsp
-
%@ page language=java contentType=text/html; charset=UTF-8
pageEncoding=UTF-8%
%@ taglib uri=/struts-tags prefix=s %
s:set name=test value=1 scope=page/
1

The result of call http://localhost:8080/myapp/test.jsp is:
a id=1 href=javascript:some-javascript-method('')1/a

as we can see, second evaluation of %{#attr.depId} is missing (must be
javascript:some-javascript-method('1')). I cannot understand why it
happens.
But when I remove line s:set name=test value=1 scope=page/ from
test2.jsp file and call again I receive correct result:
a id=1 href=javascript:some-javascript-method('1')1/a

Is this a bug or I do not understand something in Struts2?


Re: strange behavior of s:a tag with s:include tag inside

2011-07-01 Thread Александр Высоков
In attached in jira test-project (StrutsBugTest.war) index.html contains
link:
a href=test.actionclick/a

Action mapping file contains:
!DOCTYPE struts PUBLIC -//Apache Software Foundation//DTD Struts
Configuration 2.0//EN http://struts.apache.org/dtds/struts-2.0.dtd;
struts
package name=actions extends=struts-default
action name=test method=test class=sviborg.TestAction
result name=success/test.jsp/result
/action
/package
/struts

Result is the same - strange.

May be we talking about different things. I think I do not understand you
completely.

1 июля 2011 г. 19:27 пользователь Maurizio Cucchiara 
maurizio.cucchi...@gmail.com написал:

 As I said before, don't call jsp directly via browser: rather you need to
 invoke a struts action that, after looked at your action mapping
 configuration, forward the request to your final jsp

 Maurizio Cucchiara

 Il giorno 01/lug/2011 16.30, Александр Высоков nod...@gmail.com ha
 scritto:
  I've created test project (attached StrutsBugTest.war) in jira. In that
  project you can click to the link in index.html and see the same strange
  behavior.
 
  1 июля 2011 г. 17:28 пользователь Dave Newton davelnew...@gmail.com
 написал:
 
  Unless the JSP is processed through an action, the original comment in
 the
  jira ticket is correct.
 
  Recall that a filter can stop processing a request, which is what
 happens
  if
  it's not a request that hits an action.
 
  Dave
  On Jul 1, 2011 8:59 AM, Александр Высоков nod...@gmail.com wrote:
   Hello all.
  
   I have two files.
  
   test.jsp
   
   %@ page language=java contentType=text/html; charset=UTF-8
   pageEncoding=UTF-8%
   %@ taglib uri=/struts-tags prefix=s %
   s:set name=depId value=1 scope=page/
   s:a id=%{#attr.depId}
   href=javascript:some-javascript-method('%{#attr.depId}')
   s:include value=test2.jsp/
   /s:a
  
   test2.jsp
   -
   %@ page language=java contentType=text/html; charset=UTF-8
   pageEncoding=UTF-8%
   %@ taglib uri=/struts-tags prefix=s %
   s:set name=test value=1 scope=page/
   1
  
   The result of call http://localhost:8080/myapp/test.jsp is:
   a id=1 href=javascript:some-javascript-method('')1/a
  
   as we can see, second evaluation of %{#attr.depId} is missing (must be
   javascript:some-javascript-method('1')). I cannot understand why it
   happens.
   But when I remove line s:set name=test value=1 scope=page/
 from
   test2.jsp file and call again I receive correct result:
   a id=1 href=javascript:some-javascript-method('1')1/a
  
   Is this a bug or I do not understand something in Struts2?
 
 
 
 
  --
  С уважением, Александр.




-- 
С уважением, Александр.


Re: strange behavior of s:a tag with s:include tag inside

2011-07-01 Thread Dave Newton
But the include tag is still directly referencing a JSP, no?

Dave

On Friday, July 1, 2011, Александр Высоков nod...@gmail.com wrote:
 In attached in jira test-project (StrutsBugTest.war) index.html contains
 link:
 a href=test.actionclick/a

 Action mapping file contains:
 !DOCTYPE struts PUBLIC -//Apache Software Foundation//DTD Struts
 Configuration 2.0//EN http://struts.apache.org/dtds/struts-2.0.dtd;
 struts
 package name=actions extends=struts-default
 action name=test method=test class=sviborg.TestAction
 result name=success/test.jsp/result
 /action
 /package
 /struts

 Result is the same - strange.

 May be we talking about different things. I think I do not understand you
 completely.

 1 июля 2011 г. 19:27 пользователь Maurizio Cucchiara 
 maurizio.cucchi...@gmail.com написал:

 As I said before, don't call jsp directly via browser: rather you need to
 invoke a struts action that, after looked at your action mapping
 configuration, forward the request to your final jsp

 Maurizio Cucchiara

 Il giorno 01/lug/2011 16.30, Александр Высоков nod...@gmail.com ha
 scritto:
  I've created test project (attached StrutsBugTest.war) in jira. In that
  project you can click to the link in index.html and see the same strange
  behavior.
 
  1 июля 2011 г. 17:28 пользователь Dave Newton davelnew...@gmail.com
 написал:
 
  Unless the JSP is processed through an action, the original comment in
 the
  jira ticket is correct.
 
  Recall that a filter can stop processing a request, which is what
 happens
  if
  it's not a request that hits an action.
 
  Dave
  On Jul 1, 2011 8:59 AM, Александр Высоков nod...@gmail.com wrote:
   Hello all.
  
   I have two files.
  
   test.jsp
   
   %@ page language=java contentType=text/html; charset=UTF-8
   pageEncoding=UTF-8%
   %@ taglib uri=/struts-tags prefix=s %
   s:set name=depId value=1 scope=page/
   s:a id=%{#attr.depId}
   href=javascript:some-javascript-method('%{#attr.depId}')
   s:include value=test2.jsp/
   /s:a
  
   test2.jsp
   -
   %@ page language=java contentType=text/html; charset=UTF-8
   pageEncoding=UTF-8%
   %@ taglib uri=/struts-tags prefix=s %
   s:set name=test value=1 scope=page/
   1
  
   The result of call http://localhost:8080/myapp/test.jsp is:
   a id=1 href=javascript:some-javascript-method('')1/a
  
   as we can see, second evaluation of %{#attr.depId} is missing (must be
   javascript:some-javascript-method('1')). I cannot understand why it
   happens.
   But when I remove line s:set name=test value=1 scope=page/
 from
   test2.jsp file and call again I receive correct result:
   a id=1 href=javascript:some-javascript-method('1')1/a
  
   Is this a bug or I do not understand something in Struts2?
 
 
 
 
  --
  С уважением, Александр.




 --
 С уважением, Александр.


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



Re: strange behavior of s:a tag with s:include tag inside

2011-07-01 Thread Александр Высоков
So you try to tell me that in include's value must be only *.action? I think
it is not.
Documentation says that in include's value attribute may be JSP (
http://struts.apache.org/2.2.3/docs/include.html)
And in examples almost everywhere is jsp-page in include... Strange...

But I've tried your version.
I've change test.jsp to:
%@ page language=java contentType=text/html; charset=UTF-8
pageEncoding=UTF-8%
%@ taglib uri=/struts-tags prefix=s %
s:set var=depId value=1 scope=page/
s:a id=%{#attr.depId}
action=javascript:some-javascript-method('%{#attr.depId}') 
s:include value=test2.action/
/s:a

Add method to class sviborg.TestAction
public String test2() {
  return SUCCESS;
}

Add action mapping to struts.xml:
!DOCTYPE struts PUBLIC -//Apache Software Foundation//DTD Struts
Configuration 2.0//EN http://struts.apache.org/dtds/struts-2.0.dtd;
struts
package name=actions extends=struts-default
action name=test method=test class=sviborg.TestAction
result name=success/test.jsp/result
/action
action name=test2 method=test2 class=sviborg.TestAction
result name=success/test2.jsp/result
/action
/package
/struts

and then, after clicking on a href=test.action/a I received this:
a id=1 
href=javascript:some-javascript-method('1').actionhttp://localhost:8080/StrutsBugTest/javascript:some-javascript-method('1').action
/a

Wrong again. No data in the a's body.

I think it is completely wrong. And how it corellates with Maurizio
Cucchiara's words about direct call of jsp by a browser. Include's value is
called by a browser? It is not. Strange...

By the way. I tried follows - I changed the s:a tag in test.jsp with s:div:

%@ page language=java contentType=text/html; charset=UTF-8
pageEncoding=UTF-8% %@ taglib uri=/struts-tags prefix=s % s:set
var=depId value=1 scope=page/ s:div id=%{#attr.depId}
title=javascript:some-javascript-method('%{#attr.depId}')  s:include
value=test2.jsp/ /s:div

and received CORRECT result:
div id=1 title=javascript:some-javascript-method('1')1/div
Completely strange. Please tell me the difference between this cases...



1 июля 2011 г. 23:49 пользователь Dave Newton davelnew...@gmail.comнаписал:

 But the include tag is still directly referencing a JSP, no?

 Dave

 On Friday, July 1, 2011, Александр Высоков nod...@gmail.com wrote:
  In attached in jira test-project (StrutsBugTest.war) index.html contains
  link:
  a href=test.actionclick/a
 
  Action mapping file contains:
  !DOCTYPE struts PUBLIC -//Apache Software Foundation//DTD Struts
  Configuration 2.0//EN http://struts.apache.org/dtds/struts-2.0.dtd;
  struts
  package name=actions extends=struts-default
  action name=test method=test class=sviborg.TestAction
  result name=success/test.jsp/result
  /action
  /package
  /struts
 
  Result is the same - strange.
 
  May be we talking about different things. I think I do not understand you
  completely.
 
  1 июля 2011 г. 19:27 пользователь Maurizio Cucchiara 
  maurizio.cucchi...@gmail.com написал:
 
  As I said before, don't call jsp directly via browser: rather you need
 to
  invoke a struts action that, after looked at your action mapping
  configuration, forward the request to your final jsp
 
  Maurizio Cucchiara
 
  Il giorno 01/lug/2011 16.30, Александр Высоков nod...@gmail.com ha
  scritto:
   I've created test project (attached StrutsBugTest.war) in jira. In
 that
   project you can click to the link in index.html and see the same
 strange
   behavior.
  
   1 июля 2011 г. 17:28 пользователь Dave Newton davelnew...@gmail.com
  написал:
  
   Unless the JSP is processed through an action, the original comment
 in
  the
   jira ticket is correct.
  
   Recall that a filter can stop processing a request, which is what
  happens
   if
   it's not a request that hits an action.
  
   Dave
   On Jul 1, 2011 8:59 AM, Александр Высоков nod...@gmail.com
 wrote:
Hello all.
   
I have two files.
   
test.jsp

%@ page language=java contentType=text/html; charset=UTF-8
pageEncoding=UTF-8%
%@ taglib uri=/struts-tags prefix=s %
s:set name=depId value=1 scope=page/
s:a id=%{#attr.depId}
href=javascript:some-javascript-method('%{#attr.depId}')
s:include value=test2.jsp/
/s:a
   
test2.jsp
-
%@ page language=java contentType=text/html; charset=UTF-8
pageEncoding=UTF-8%
%@ taglib uri=/struts-tags prefix=s %
s:set name=test value=1 scope=page/
1
   
The result of call http://localhost:8080/myapp/test.jsp is:
a id=1 href=javascript:some-javascript-method('')1/a
   
as we can see, second evaluation of %{#attr.depId} is missing (must
 be
javascript:some-javascript-method('1')). I cannot understand why it
happens.
But when I remove line s:set name=test value=1 scope=page/
  from
test2.jsp file and call again I receive correct result:
a id=1 href=javascript:some-javascript-method('1')1/a
   
Is this a bug or I do not understand something in Struts2?
  
  
  
  
   --
   С 

Re: strange behavior of s:a tag with s:include tag inside

2011-07-01 Thread Dave Newton
2011/7/1 Александр Высоков nod...@gmail.com:
 So you try to tell me that in include's value must be only *.action?

No, I don't.

Dave

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



Re: strange behavior of s:a tag with s:include tag inside

2011-07-01 Thread Александр Высоков
Dave, if I expressed roughly, I am very sorry (my bad english is not good
enough).
But if I misunderstand you, please explain more details. Thank you.

2 июля 2011 г. 0:41 пользователь Dave Newton davelnew...@gmail.comнаписал:

 2011/7/1 Александр Высоков nod...@gmail.com:
  So you try to tell me that in include's value must be only *.action?

 No, I don't.

 Dave

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




-- 
С уважением, Александр.


Re: strange behavior of s:a tag with s:include tag inside

2011-07-01 Thread Dave Newton
2011/7/1 Александр Высоков nod...@gmail.com:
 Dave, if I expressed roughly, I am very sorry (my bad english is not good 
 enough).

Nope, you're doing great :)

Try using a link to an action in the s:include tag instead of a plain JSP.

For now you could just create a class-less action mapping that
forwards to the JSP you're currently using. See if the behavior
continues.

Dave

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



Re: strange behavior of s:a tag with s:include tag inside

2011-07-01 Thread Александр Высоков
Do you mean
s:url action=test2 var=ac/
s:include value=%{ac}/
?

Tried. Empty body of a tag.


2 июля 2011 г. 0:56 пользователь Dave Newton davelnew...@gmail.comнаписал:

 2011/7/1 Александр Высоков nod...@gmail.com:
  Dave, if I expressed roughly, I am very sorry (my bad english is not good
 enough).

 Nope, you're doing great :)

 Try using a link to an action in the s:include tag instead of a plain
 JSP.

 For now you could just create a class-less action mapping that
 forwards to the JSP you're currently using. See if the behavior
 continues.

 Dave

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




-- 
С уважением, Александр.


[s2] accesing params from s:include tag

2009-02-27 Thread hernan gonzalez
I'm struggling with s:include + s:param in struts 2.0.14

The docs  for the include tag http://struts.apache.org/2.0.14/docs/include.html
states:

How To access parameters  Parameters are passed as request
parameters, so use the ${param.ParamName} notation to access  them. Do
not use the property tag to access parameters in included files.

That's not very clear for me, (and for others, judging from old
messages in the list).
The parameters passed to an included jsp via struts2 tags can't be
accesed using struts2 tags??
(it appears that the parameters are not added to the parameters
collection in the actionContext)

This should be really simple, please, can't someone give an example ?

Say I have a page.jsp that includes a fragment jsp file via the following:

s:include value=frag.jsps:param name=opt1/s:param/s:include

In the frag.jsp I want to do something as

s:if test=#parameters.opt == 1 ... /s2:if

What would be the correct syntax?

Hernán J. González

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



Re: [s2] accesing params from s:include tag

2009-02-27 Thread Nils-Helge Garli Hegvik
Haven't really tried, but I assume the parameter would be a String, so
have you tried using 'eq' instead of '=='.

Nils-H

On Fri, Feb 27, 2009 at 3:06 PM, hernan gonzalez hgonza...@gmail.com wrote:
 I'm struggling with s:include + s:param in struts 2.0.14

 The docs  for the include tag 
 http://struts.apache.org/2.0.14/docs/include.html
 states:

 How To access parameters  Parameters are passed as request
 parameters, so use the ${param.ParamName} notation to access  them. Do
 not use the property tag to access parameters in included files.

 That's not very clear for me, (and for others, judging from old
 messages in the list).
 The parameters passed to an included jsp via struts2 tags can't be
 accesed using struts2 tags??
 (it appears that the parameters are not added to the parameters
 collection in the actionContext)

 This should be really simple, please, can't someone give an example ?

 Say I have a page.jsp that includes a fragment jsp file via the following:

 s:include value=frag.jsps:param name=opt1/s:param/s:include

 In the frag.jsp I want to do something as

 s:if test=#parameters.opt == 1 ... /s2:if

 What would be the correct syntax?

 Hernán J. González

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



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



Re: [s2] accesing params from s:include tag

2009-02-27 Thread Struts Two
I do not think you will be able to access the param value passed to s:include 
within struts tag [clearly an obvious shortcoming]. Your best bet is using jsp 
expression language as the parameter is put in request scope.

I was not able to do it, despite trying a million different forms as well as 
suggestions by some folks in strust mailing list.


--- On Fri, 2/27/09, Nils-Helge Garli Hegvik nil...@gmail.com wrote:

 From: Nils-Helge Garli Hegvik nil...@gmail.com
 Subject: Re: [s2] accesing params from s:include tag
 To: Struts Users Mailing List user@struts.apache.org
 Received: Friday, February 27, 2009, 2:14 PM
 Haven't really tried, but I assume the parameter would
 be a String, so
 have you tried using 'eq' instead of '=='.
 
 Nils-H
 
 On Fri, Feb 27, 2009 at 3:06 PM, hernan gonzalez
 hgonza...@gmail.com wrote:
  I'm struggling with s:include + s:param in struts
 2.0.14
 
  The docs  for the include tag
 http://struts.apache.org/2.0.14/docs/include.html
  states:
 
  How To access parameters  Parameters are passed
 as request
  parameters, so use the ${param.ParamName} notation to
 access  them. Do
  not use the property tag to access parameters in
 included files.
 
  That's not very clear for me, (and for others,
 judging from old
  messages in the list).
  The parameters passed to an included jsp via struts2
 tags can't be
  accesed using struts2 tags??
  (it appears that the parameters are not added to the
 parameters
  collection in the actionContext)
 
  This should be really simple, please, can't
 someone give an example ?
 
  Say I have a page.jsp that includes a fragment
 jsp file via the following:
 
  s:include
 value=frag.jsps:param
 name=opt1/s:param/s:include
 
  In the frag.jsp I want to do something as
 
  s:if test=#parameters.opt == 1 ...
 /s2:if
 
  What would be the correct syntax?
 
  Hernán J. González
 
 
 -
  To unsubscribe, e-mail:
 user-unsubscr...@struts.apache.org
  For additional commands, e-mail:
 user-h...@struts.apache.org
 
 
 
 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail:
 user-h...@struts.apache.org


  __
Instant Messaging, free SMS, sharing photos and more... Try the new Yahoo! 
Canada Messenger at http://ca.beta.messenger.yahoo.com/


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



Re: [s2] accesing params from s:include tag

2009-02-27 Thread hernan gonzalez
 I was not able to do it, despite trying a million different forms as well as 
 suggestions by some folks in strust mailing list.
 I do not think you will be able to access the param value passed to s:include 
 within struts tag [clearly an obvious shortcoming]. Your best bet is using 
 jsp expression language as the parameter is put in request scope.


Indeed a shortcoming, and a frustrating one.
Wouldn this be partially fixed if, when the  s:include/s:param are
evaluated, the params are also put into the parameters object in the
ActionContext? Are there good reasons to not doing so ?


BTW, although I much prefer Struts2 over Struts1, the fact that many
developers -not gurus, but with some months of s2 experience-
frequently need to try million different forms ( # % $  params
parameters etc etc) till (in the best scenario) it happens to work,
should tell something...


Hernán J. González

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



Re: [s2] accesing params from s:include tag

2009-02-27 Thread Nils-Helge Garli Hegvik
You're right. I should have read the documentation more closely. It
clearly states that no stack is created and you have to access the
parameters through the regular servlet objects. If you believe this is
a shortcoming, you could register a JIRA issue for it, unless there is
one already.

Nils-H

On Fri, Feb 27, 2009 at 5:23 PM, hernan gonzalez hgonza...@gmail.com wrote:
 I was not able to do it, despite trying a million different forms as well as 
 suggestions by some folks in strust mailing list.
 I do not think you will be able to access the param value passed to 
 s:include within struts tag [clearly an obvious shortcoming]. Your best bet 
 is using jsp expression language as the parameter is put in request scope.


 Indeed a shortcoming, and a frustrating one.
 Wouldn this be partially fixed if, when the  s:include/s:param are
 evaluated, the params are also put into the parameters object in the
 ActionContext? Are there good reasons to not doing so ?


 BTW, although I much prefer Struts2 over Struts1, the fact that many
 developers -not gurus, but with some months of s2 experience-
 frequently need to try million different forms ( # % $  params
 parameters etc etc) till (in the best scenario) it happens to work,
 should tell something...


 Hernán J. González

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



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



Re: S2: s:include tag and s:param

2008-07-29 Thread Eric Nielsen
So I tried the param. access path last night.  That wasn't working, the
documentation referenced a parameters. instead.  I managed to get that working
with s:component, but no luck with s:include.

I don't really care if I use component versus include; however I liked the
include slightly better since I was easily able to place my jsp
fragment/component underneath WEB-INF.  When I tried using struts.ui.templateDir
to move the template directory used by s:component under WEB-INF, it appears to
break all the regular struts 2 tags.  Is there a good way of locating
application custom templates underneath WEB-INF without breaking the search path
for the existing tag/themes?

Eric



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: S2: s:include tag and s:param

2008-07-28 Thread Dave Newton
--- On Sun, 7/27/08, Dave Newton [EMAIL PROTECTED] wrote:
 (That being said, as this question seems to come up rather
 frequently, maybe the include tag should add its params to
 the request used for the include, if that's possible?)

It already does; not sure what I was thinking there. (I do know; I was looking 
at the wrong code.)

I'm able to access parameters set via a nested s:param.../ using both c:out 
value=${param.foo}/ and ${param.foo}. 

If the value is coming from the action then you shouldn't even need to set it 
via an s:param.../ since the value stack is available in included 
pages--action properties are available via both S2 tags and EL (via the custom 
request hoobie-doobie).

Dave


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: S2: s:include tag and s:param

2008-07-28 Thread Eric Nielsen
Dave Newton newton.dave at yahoo.com writes:
 It already does; not sure what I was thinking there. (I do know; I was looking
at the wrong code.)
 
 I'm able to access parameters set via a nested s:param.../ using both c:out
value=${param.foo}/
 and ${param.foo}. 
 
 If the value is coming from the action then you shouldn't even need to set it
via an s:param.../ since the
 value stack is available in included pages--action properties are available
via both S2 tags and EL (via
 the custom request hoobie-doobie).

OK I'm now a little confused.  It sounds like you're reversing yourself from the
first reply and that what I was trying should work?  Can you see something
different between your test case and the code I sent before?  

I can't use use the action's properties, since different actions back the
different views that use this snippet.  In all cases the needed property is
navigateable from exposed properties, however.  Hence the desire to use the
include to effectively rename the property from the main result jsp to the
included snippet.

Eric


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: S2: s:include tag and s:param

2008-07-28 Thread Dave Newton
--- On Mon, 7/28/08, Eric Nielsen [EMAIL PROTECTED] wrote:
 Dave Newton newton.dave at yahoo.com writes:
  It already does; not sure what I was thinking there.
 (I do know; I was looking
 at the wrong code.)
  
  I'm able to access parameters set via a nested
 s:param.../ using both c:out
 value=${param.foo}/
  and ${param.foo}. 
 
 OK I'm now a little confused.  It sounds like you're reversing
 yourself from the first reply and that what I was trying should work?

Yeah, that was why I said not sure what I was thinking (but I do know; I was 
looking at the wrong method).

 Can you see something different between your test case and 
 the code I sent before?  

I used the word param in my EL.

Dave


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: S2: s:include tag and s:param

2008-07-28 Thread Becky . L . O'Sullivan
Yes you can access them via JSTL, like Dave mentioned (using ${param.xx} ),
but not via OGNL.
If you want to access those params via OGNL use JSTL to set them into the
page scope, then use #attr to get them.
I hate JSTL's choose/otherwise tags, and prefer struts if/else tags, so I
use this a lot in that situation.


s:include value=/WEB-INF/components/competitions/identity-readonly.jsp
  s:param name=comp value=competition /
/s:include



%@ taglib prefix=c uri=http://java.sun.com/jsp/jstl/core; %
c:set var=comp value=${param.comp}/

div class=primaryBox
  h1Competition Information/h1
  s:property escape=false value=#attr.comp /
/div











   
 Dave Newton   
 [EMAIL PROTECTED] 
 o.com To 
   Struts Users Mailing List   
 07/28/2008 07:18  user@struts.apache.org
 AM cc 
   
   Subject 
 Please respond to Re: S2: s:include tag and s:param   
   Struts Users   
   Mailing List   
 [EMAIL PROTECTED] 
  he.org  
   
   




--- On Mon, 7/28/08, Eric Nielsen [EMAIL PROTECTED] wrote:
 Dave Newton newton.dave at yahoo.com writes:
  It already does; not sure what I was thinking there.
 (I do know; I was looking
 at the wrong code.)
 
  I'm able to access parameters set via a nested
 s:param.../ using both c:out
 value=${param.foo}/
  and ${param.foo}.

 OK I'm now a little confused.  It sounds like you're reversing
 yourself from the first reply and that what I was trying should work?

Yeah, that was why I said not sure what I was thinking (but I do know; I
was looking at the wrong method).

 Can you see something different between your test case and
 the code I sent before?

I used the word param in my EL.

Dave


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
This message, together with any attachments, is
intended only for the use of the individual or entity
to which it is addressed. It may contain information
that is confidential and prohibited from disclosure.
If you are not the intended recipient, you are hereby
notified that any dissemination or copying of this
message or any attachment is strictly prohibited. If
you have received this message in error, please notify
the original sender immediately by telephone or by
return e-mail and delete this message, along with any
attachments, from your computer. Thank you.

-

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: S2: s:include tag and s:param

2008-07-28 Thread Dave Newton
--- On Mon, 7/28/08, Becky.L.O'[EMAIL PROTECTED] wrote:
 If you want to access those params via OGNL use JSTL to set
 them into the page scope, then use #attr to get them.

Or in request scope, then you don't need to specify scope or #attr, IIRC.

Dave


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



S2: s:include tag and s:param

2008-07-27 Thread Eric D Nielsen
I've been having trouble getting s:include and s:param to work.

I have a snippet I want to include in multiple pages.  This snippet will want to
make use of Struts 2 tags and OGNL, though at present I just need a simple
c:out.

The snippet looks like:
%@ taglib prefix=c uri=http://java.sun.com/jsp/jstl/core; %
div class=primaryBox
  h1Competition Information/h1
  c:out value=${comp.name} /
/div
- END --

I'm currently using it with:
s:include value=/WEB-INF/components/competitions/identity-readonly.jsp
  s:param name=comp value=competition /
/s:include
 END -

The c:out isn't printing anything.

I've tried using ${} notation in the param value; that doesn't lead any
different behavoir for me.

If I reference competition.name in the snippet and skip the s:param, everything
works on this page (because the action exposes the competition property. 
However other pages that include it will not expose it directly (but I can
navigate to it from properties that are exposed).

What am I missing?

Eric


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: S2: s:include tag and s:param

2008-07-27 Thread Dave Newton
IIRC the s:param.../ tag is for parameterizing components; AFAIK it doesn't 
add anything to a scope.

(That being said, as this question seems to come up rather frequently, maybe 
the include tag should add its params to the request used for the include, if 
that's possible?)

Dave

--- On Sun, 7/27/08, Eric D Nielsen [EMAIL PROTECTED] wrote:
 I've been having trouble getting s:include and s:param to work.
 
 I have a snippet I want to include in multiple pages.  This
 snippet will want to make use of Struts 2 tags and OGNL, 
 though at present I just need a simple c:out.
 
 The snippet looks like:
 %@ taglib prefix=c
 uri=http://java.sun.com/jsp/jstl/core; %
 div class=primaryBox
   h1Competition Information/h1
   c:out value=${comp.name} /
 /div
 - END --
 
 I'm currently using it with:
 s:include
 value=/WEB-INF/components/competitions/identity-readonly.jsp
 s:param name=comp
 value=competition /
 /s:include
  END -
 
 The c:out isn't printing anything.
 
 I've tried using ${} notation in the param value; that
 doesn't lead any
 different behavoir for me.
 
 If I reference competition.name in the snippet and skip the
 s:param, everything
 works on this page (because the action exposes the
 competition property. 
 However other pages that include it will not expose it
 directly (but I can
 navigate to it from properties that are exposed).
 
 What am I missing?
 
 Eric


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



s:include tag

2007-09-18 Thread Sairam01

I'm unable to include a jsp dynamically. The include tag doesn't evaluate
VALUE of the expression.

s:include value=%{someName}.jsp/

someName is a attribute on my action code. Should this work..? 
-- 
View this message in context: 
http://www.nabble.com/s%3Ainclude-tag-tf4476115.html#a12763052
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: s:include tag

2007-09-18 Thread Piero Sartini
Am Dienstag, 18. September 2007 20:22:41 schrieb Sairam01:
 I'm unable to include a jsp dynamically. The include tag doesn't evaluate
 VALUE of the expression.

 s:include value=%{someName}.jsp/

 someName is a attribute on my action code. Should this work..?

s:include value=%{someName}.jsp/

is this a typo in the email? it should read
s:include value=%{someName}.jsp/

if there is a proper getSomeName() method in your action, this should work.. 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]