Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I am working on converting a Struts 1 app to Struts 2. I have a jsp that has several JSP included. This included JSPs all have the <nested:root> tag on it.

I have found little to nothing on this particular tag except that is similar to <html:root>, so I've added the include statement in my main JSP and I added the <html:form> to the sub JSPs but it didn't work.

I had initially just added <s:form> to the sub JSPs and the code in the sub JSP was passed along but none of the tags existing in the sub JSP were processed.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
156 views
Welcome To Ask or Share your Answers For Others

1 Answer

All nested tags and all Struts1 tags should be removed/replaced with equivalent Struts2 tags.

Nested tags not needed in Struts2 because it's powered with OGNL. Using OGNL expressions and <s:include> allows to replace nested tags.

If it's not enough to render content with s:include you can use <s:action> but it's heavy and it recreates a valueStack when this tag executes, so it's rarely used, but custom tags or custom components that include Fremarker or Velocity templates can significantly change the rendering time and allows customization.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share

548k questions

547k answers

4 comments

86.3k users

...