You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Arpan <ar...@gmail.com> on 2013/08/06 16:13:15 UTC

struts 1 to struts2 migration.

Hi All,

We are migrating from struts1 to struts2.

In our pages we have multiple buttons which through struts1 DispatchAction
can be guided  to different methods in Action class. For that we need
minimal changes. Such as
 In action mapping if we add parameter="action" and in JSP if the URL is
like x.do?action=method1, it happily directs the control to method1 in
Action class.

I got the bellow link for struts2, but for that also we need much changes
to be done.
http://struts.apache.org/development/2.x/docs/multiple-submit-buttons.html

Is there any such way we do similar functionality in struts2 with minimal
changes.

Thanks

Re: AJAX Jsp tags

Posted by Chris Pratt <th...@gmail.com>.
You are right, if Struts only ever delivers one HTML page, there's no need
for Tiles.  But as soon as you add a second page with shared layout
components, it will definitely be a benefit.
  (*Chris*)
On Aug 12, 2013 4:21 AM, "Alireza Fattahi" <af...@yahoo.com> wrote:

> Thanks for you comments !!
>
> I have a question about tiles. I used tiles a lot in normal NON-AJAX base
> sites.
> Now I am designing a new fully ajax base site.
> My question is why should I use tiles! The code which contains the base
> layout is written once.
> Consider below layout
> ----------------------------------------------------------------
> |
> |
> |           Header                                                       |
> |
> |
> ----------------------------------------------------------------
> ----------------------------------------------------------------
> |
> |
> | Menu1    Menu2  Menu3                                       |
> |
> |
> ----------------------------------------------------------------
>
> |
> |
>
> |
> |
> |
> |
> |             Page content                                           |
> |
> |
> |
> |
> |
> |
> |
> |
> ----------------------------------------------------------------
> |
> |
> |           FOOTER                                                  |
> |
> |
> ----------------------------------------------------------------
>
>
> There will be a HomePage.jsp, which will have the structure of above above
> layout Menus, PageContent, Footer. The HomePage.jsp will have all the DIVs
> to layout the page. Then there will be a DIV for page conetent which will
> be changed when users click the menu.
>
> So, when user clicks the menu1 link the Ajax will replace the page content
> with page1.jsp. And all the remaining part of the page will not reload from
> server!
> The page1.jsp will only have the required content of page1, it will not
> have any header, menu and footer.
>
> I though that with Ajax technology there we will not required to use tiles
> any more.
>
>
> ~Regards,
> ~~Alireza Fattahi
>
>
> ________________________________
>  From: Chris Pratt <th...@gmail.com>
> To: Struts Users Mailing List <us...@struts.apache.org>
> Cc: Alireza Fattahi <af...@yahoo.com>
> Sent: Monday, 12 August 2013, 10:50
> Subject: Re: AJAX Jsp tags
>
>
> Excellent post Ken.  I absolutely agree with everything you mention.  I too
> use jQuery and jQuery UI directly in my JSP templates (not through some tag
> library) and find it easier and more powerful.  I can also throw in a +1
> for Tiles as a compositing technology that is indispensable in large sites.
>   (*Chris*)
>
>
> On Sun, Aug 11, 2013 at 10:26 PM, Ken McWilliams
> <ke...@gmail.com>wrote:
>
> > I have some experience creating custom struts2 tags, but for ajax I do
> not
> > advise this route at all.  XML is not meant as a replacement for a
> > programming language, it is meant for configuration. It might seem
> > intuitive without further investigation that there are a limited number
> of
> > HTML UI elements and their functionality quite straight forward and so it
> > would seem reasonable that a configuration only route could work in the
> > general case. This is wrong as evidenced by all efforts to define dynamic
> > UI elements using XML.
> >
> > Even JavaFX tried to use xml and that was abandoned, they had the benefit
> > of designing the entire environment from the ground up, which is hardly
> the
> > case here.
> >
> > Not sure if you are familiar with the popular Question and Answer site
> > "Stack Overflow", however a great many questions regarding the struts2
> ajax
> > tags go unanswered. If people could find solutions for their
> configuration
> > issues I wouldn't be so open with my negative view of ajax tags. Since it
> > is most often new users of Struts2 that attempt to use these tags and to
> > what appears to be dismal results I can't help but think that these tags
> > may actually be of harm to the struts2 image.
> >
> > I've only experimented with the jquery ajax tags breifly and experienced
> > frustration. Also before that experimented with the now deprecated dojo
> > tags. I had used the dojo tags within their prescribed limits but it is
> > much more enjoyable to have freedom. They were just too cumbersome. As
> soon
> > as you use JavaScript everything is far easier.
> >
> > Try to use Unobtrusive JavaScript:
> > http://en.wikipedia.org/wiki/Unobtrusive_JavaScript
> >
> > This will make your html "tag like" while allowing you to use the
> > JavaScript APIs as intended.
> >
> > It is worth noting that the tag libraries can be used as templates. I
> bring
> > this up because one natural objection to not using a tag library would
> be a
> > loss in terms of this particular use. There are a number of other
> solutions
> > in this area one of them is Apache Tiles. JSPs, Freemarker, and Velocity
> > are all view technologies and while they have facilities for templates it
> > isn't their first concern. Apache tiles and Sitemesh both address the
> issue
> > of reducing boiler plate head on. Tiles does not try to do what the
> > aforementioned view technologies do, instead think of it as a way to
> factor
> > commonality out of any of those view technologies. As such both Apache
> > Tiles is a meta-view technology.
> >
> > What I advise:
> >
> > 1) Avoid ajax tag libraries and write JavaScript by hand - even if you
> > don't know JS, you will be able to understand the documentation of the
> > popular JS UI elements and achieve the same level of functionality as
> > provided by the ajax tags even if all you do is cut and paste
> programming.
> > 2) Follow the Unobtrusive JavaScript practice.
> > 3) When writing JS do not hard code URLs use the struts2 URL tag (It will
> > pick up changes to the context root that way).
> > 4) When asking for help with the client side, no one needs to know what
> > server side technology is used. The is greatly improve your chances for
> > positive feedback.
> > 5) Use the Struts2-JSON plugin to produce data for your ajax consuming UI
> > elements and also as a means of accepting JSON data into actions.
> > 6) When asking for server side support, try to insulate the audience from
> > your particular JS. (Determine that the correct data is being sent to the
> > server, if it not the issue is a client side, if the correct data is
> being
> > sent only provide that data [the query string or the JSON string]).
> > 7) Use firebug plugin fore Firefox, it is a huge help.
> > ------------
> > 8) Should you feel the need for a stronger templates solution consider
> > tiles (or sitemesh), this link points to it in a rather current use of
> it:
> > http://tech.finn.no/2012/07/25/the-ultimate-view-tiles-3/
> >
> > Hope the reasoning is clear enough. I sincerely want to save you and
> anyone
> > else with similar concern some time and sanity.
> >
> >
> >
> >
> >
> > On Sat, Aug 10, 2013 at 3:05 AM, Alireza Fattahi <af...@yahoo.com>
> > wrote:
> >
> > > Thanks for your comment.
> > > Did you have any experience with struts jquery tag or other tags too?
> > > Or you complete suggest that we write our own tags !
> > >
> > >
> > >
> > > ~Regards,
> > > ~~Alireza Fattahi
> > >
> > >
> > > ________________________________
> > >  From: Ken McWilliams <ke...@gmail.com>
> > > To: Struts Users Mailing List <us...@struts.apache.org>
> > > Sent: Friday, 9 August 2013, 8:22
> > > Subject: Re: AJAX Jsp tags
> > >
> > >
> > > Don't use a JSP AJAX tag library. The dojo JSP tags didn't work well
> not
> > > because of dojo or an fault of the tag authors, the technologies simply
> > > don't mesh. It's as sane to program Java via XML as it is to program
> > > JavaScript via XML.
> > >
> > > XML is used for configuration. At first glance you think you'll only
> need
> > > trivial behaviour but this is seldom ever the case,  JS UI components
> are
> > > much easier to work with and you will need to provide your own
> handlers,
> > > which are often required even in the simple cases. XML can not account
> > for
> > > all these cases and does not provides the means to add custom handlers
> > in a
> > > way that would be as simple as using the underlying JS framework
> > naturally.
> > >
> > > Further the tag authors often lag behind the UI components that they
> > wrap,
> > > the documentation and features often fall behind too.
> > >
> > > With even a trivial understanding of JS you should be able to produce
> the
> > > same results as the Tags in the same time frame, as you gain experience
> > > you'll quickly superseded the capabilities of any tag library.
> > >
> > >
> > >
> > >
> > >
> > > On Thu, Aug 8, 2013 at 11:02 AM, Chris Pratt <thechrispratt@gmail.com
> > > >wrote:
> > >
> > > > The dojo based tags are deprecated, the jQuery based tags are not.
> > > >   (*Chris*)
> > > >
> > > >
> > > > On Thu, Aug 8, 2013 at 9:54 AM, Alireza Fattahi <af...@yahoo.com>
> > > > wrote:
> > > >
> > > > > Hi,
> > > > >
> > > > > I have confused with struts 2 ajax please correct me:
> > > > > 1- The dojo plugin is deprecated (
> > > > > http://struts.apache.org/release/2.3.x/docs/ajax-tags.html)
> > > > > 2- According to above we are not recommended to use dojo plugin in
> > new
> > > > > projects.
> > > > >  3- All tags that mentioned in above page like: a,
> autocompliter,bind
> > > ...
> > > > > shall not be used.
> > > > > 4- According to page
> > > > http://struts.apache.org/release/2.3.x/docs/ajax.html
> > > > > :
> > > > > "....First, you can use some type of JSP tag. Here, you don't have
> to
> > > > know
> > > > > very much at all about Ajax or JavaScript. The taglib does all the
> > > work,
> > > > > and you just have to figure out how to use the taglib. The standard
> > > > > Struts 2 taglib includes several Ajax JSP tags,"
> > > > > 5- The "Ajax JSP tags" link above will redirect to
> > > > > http://struts.apache.org/release/2.3.x/docs/ajax-tags.html, which
> is
> > > > > deprecated!!
> > > > >
> > > > > I don't get it !
> > > > > Can we use AJAX Jsp tags or they are deprecated ?
> > > > >
> > > > >
> > > > > ~Regards,
> > > > > ~~Alireza Fattahi
> > > > >
> > > >
> > >
> >

RE: AJAX Jsp tags

Posted by Martin Gainty <mg...@hotmail.com>.
in struts-config.xml you will need configure in struts-tiles-plugin and 
you will need tiles-defs.xml to reflect each individual tile section  jsps 
 
e.g.
 
<plug-in className="org.apache.struts.tiles.TilesPlugin" >
		<set-property property="definitions-config"
		value="/WEB-INF/tiles-defs.xml"/>
	</plug-in>

http://www.mkyong.com/struts/struts-tiles-framework-example/

Martin 
______________________________________________ 

 

> Date: Mon, 12 Aug 2013 04:20:50 -0700
> From: afattahi@yahoo.com
> Subject: Re: AJAX Jsp tags
> To: user@struts.apache.org
> 
> Thanks for you comments !!
> 
> I have a question about tiles. I used tiles a lot in normal NON-AJAX base sites.
> Now I am designing a new fully ajax base site. 
> My question is why should I use tiles! The code which contains the base layout is written once. 
> Consider below layout
> ----------------------------------------------------------------
> |                                                                            |
> |           Header                                                       |
> |                                                                            |
> ----------------------------------------------------------------
> ----------------------------------------------------------------
> |                                                                            |
> | Menu1    Menu2  Menu3                                       | 
> |                                                                            |
> ----------------------------------------------------------------
> 
> |                                                                            |
> 
> |                                                                            |
> |                                                                            |
> |             Page content                                           |
> |                                                                            |
> |                                                                            |
> |                                                                            |
> |                                                                            |
> ----------------------------------------------------------------
> |                                                                            |
> |           FOOTER                                                  |
> |                                                                            |
> ----------------------------------------------------------------
> 
> 
> There will be a HomePage.jsp, which will have the structure of above above layout Menus, PageContent, Footer. The HomePage.jsp will have all the DIVs to layout the page. Then there will be a DIV for page conetent which will be changed when users click the menu.
> 
> So, when user clicks the menu1 link the Ajax will replace the page content with page1.jsp. And all the remaining part of the page will not reload from server!
> The page1.jsp will only have the required content of page1, it will not have any header, menu and footer.
> 
> I though that with Ajax technology there we will not required to use tiles any more.  
> 
> 
> ~Regards,
> ~~Alireza Fattahi
> 
> 
> ________________________________
>  From: Chris Pratt <th...@gmail.com>
> To: Struts Users Mailing List <us...@struts.apache.org> 
> Cc: Alireza Fattahi <af...@yahoo.com> 
> Sent: Monday, 12 August 2013, 10:50
> Subject: Re: AJAX Jsp tags
>  
> 
> Excellent post Ken.  I absolutely agree with everything you mention.  I too
> use jQuery and jQuery UI directly in my JSP templates (not through some tag
> library) and find it easier and more powerful.  I can also throw in a +1
> for Tiles as a compositing technology that is indispensable in large sites.
>   (*Chris*)
> 
> 
> On Sun, Aug 11, 2013 at 10:26 PM, Ken McWilliams
> <ke...@gmail.com>wrote:
> 
> > I have some experience creating custom struts2 tags, but for ajax I do not
> > advise this route at all.  XML is not meant as a replacement for a
> > programming language, it is meant for configuration. It might seem
> > intuitive without further investigation that there are a limited number of
> > HTML UI elements and their functionality quite straight forward and so it
> > would seem reasonable that a configuration only route could work in the
> > general case. This is wrong as evidenced by all efforts to define dynamic
> > UI elements using XML.
> >
> > Even JavaFX tried to use xml and that was abandoned, they had the benefit
> > of designing the entire environment from the ground up, which is hardly the
> > case here.
> >
> > Not sure if you are familiar with the popular Question and Answer site
> > "Stack Overflow", however a great many questions regarding the struts2 ajax
> > tags go unanswered. If people could find solutions for their configuration
> > issues I wouldn't be so open with my negative view of ajax tags. Since it
> > is most often new users of Struts2 that attempt to use these tags and to
> > what appears to be dismal results I can't help but think that these tags
> > may actually be of harm to the struts2 image.
> >
> > I've only experimented with the jquery ajax tags breifly and experienced
> > frustration. Also before that experimented with the now deprecated dojo
> > tags. I had used the dojo tags within their prescribed limits but it is
> > much more enjoyable to have freedom. They were just too cumbersome. As soon
> > as you use JavaScript everything is far easier.
> >
> > Try to use Unobtrusive JavaScript:
> > http://en.wikipedia.org/wiki/Unobtrusive_JavaScript
> >
> > This will make your html "tag like" while allowing you to use the
> > JavaScript APIs as intended.
> >
> > It is worth noting that the tag libraries can be used as templates. I bring
> > this up because one natural objection to not using a tag library would be a
> > loss in terms of this particular use. There are a number of other solutions
> > in this area one of them is Apache Tiles. JSPs, Freemarker, and Velocity
> > are all view technologies and while they have facilities for templates it
> > isn't their first concern. Apache tiles and Sitemesh both address the issue
> > of reducing boiler plate head on. Tiles does not try to do what the
> > aforementioned view technologies do, instead think of it as a way to factor
> > commonality out of any of those view technologies. As such both Apache
> > Tiles is a meta-view technology.
> >
> > What I advise:
> >
> > 1) Avoid ajax tag libraries and write JavaScript by hand - even if you
> > don't know JS, you will be able to understand the documentation of the
> > popular JS UI elements and achieve the same level of functionality as
> > provided by the ajax tags even if all you do is cut and paste programming.
> > 2) Follow the Unobtrusive JavaScript practice.
> > 3) When writing JS do not hard code URLs use the struts2 URL tag (It will
> > pick up changes to the context root that way).
> > 4) When asking for help with the client side, no one needs to know what
> > server side technology is used. The is greatly improve your chances for
> > positive feedback.
> > 5) Use the Struts2-JSON plugin to produce data for your ajax consuming UI
> > elements and also as a means of accepting JSON data into actions.
> > 6) When asking for server side support, try to insulate the audience from
> > your particular JS. (Determine that the correct data is being sent to the
> > server, if it not the issue is a client side, if the correct data is being
> > sent only provide that data [the query string or the JSON string]).
> > 7) Use firebug plugin fore Firefox, it is a huge help.
> > ------------
> > 8) Should you feel the need for a stronger templates solution consider
> > tiles (or sitemesh), this link points to it in a rather current use of it:
> > http://tech.finn.no/2012/07/25/the-ultimate-view-tiles-3/
> >
> > Hope the reasoning is clear enough. I sincerely want to save you and anyone
> > else with similar concern some time and sanity.
> >
> >
> >
> >
> >
> > On Sat, Aug 10, 2013 at 3:05 AM, Alireza Fattahi <af...@yahoo.com>
> > wrote:
> >
> > > Thanks for your comment.
> > > Did you have any experience with struts jquery tag or other tags too?
> > > Or you complete suggest that we write our own tags !
> > >
> > >
> > >
> > > ~Regards,
> > > ~~Alireza Fattahi
> > >
> > >
> > > ________________________________
> > >  From: Ken McWilliams <ke...@gmail.com>
> > > To: Struts Users Mailing List <us...@struts.apache.org>
> > > Sent: Friday, 9 August 2013, 8:22
> > > Subject: Re: AJAX Jsp tags
> > >
> > >
> > > Don't use a JSP AJAX tag library. The dojo JSP tags didn't work well not
> > > because of dojo or an fault of the tag authors, the technologies simply
> > > don't mesh. It's as sane to program Java via XML as it is to program
> > > JavaScript via XML.
> > >
> > > XML is used for configuration. At first glance you think you'll only need
> > > trivial behaviour but this is seldom ever the case,  JS UI components are
> > > much easier to work with and you will need to provide your own handlers,
> > > which are often required even in the simple cases. XML can not account
> > for
> > > all these cases and does not provides the means to add custom handlers
> > in a
> > > way that would be as simple as using the underlying JS framework
> > naturally.
> > >
> > > Further the tag authors often lag behind the UI components that they
> > wrap,
> > > the documentation and features often fall behind too.
> > >
> > > With even a trivial understanding of JS you should be able to produce the
> > > same results as the Tags in the same time frame, as you gain experience
> > > you'll quickly superseded the capabilities of any tag library.
> > >
> > >
> > >
> > >
> > >
> > > On Thu, Aug 8, 2013 at 11:02 AM, Chris Pratt <thechrispratt@gmail.com
> > > >wrote:
> > >
> > > > The dojo based tags are deprecated, the jQuery based tags are not.
> > > >   (*Chris*)
> > > >
> > > >
> > > > On Thu, Aug 8, 2013 at 9:54 AM, Alireza Fattahi <af...@yahoo.com>
> > > > wrote:
> > > >
> > > > > Hi,
> > > > >
> > > > > I have confused with struts 2 ajax please correct me:
> > > > > 1- The dojo plugin is deprecated (
> > > > > http://struts.apache.org/release/2.3.x/docs/ajax-tags.html)
> > > > > 2- According to above we are not recommended to use dojo plugin in
> > new
> > > > > projects.
> > > > >  3- All tags that mentioned in above page like: a, autocompliter,bind
> > > ...
> > > > > shall not be used.
> > > > > 4- According to page
> > > > http://struts.apache.org/release/2.3.x/docs/ajax.html
> > > > > :
> > > > > "....First, you can use some type of JSP tag. Here, you don't have to
> > > > know
> > > > > very much at all about Ajax or JavaScript. The taglib does all the
> > > work,
> > > > > and you just have to figure out how to use the taglib. The standard
> > > > > Struts 2 taglib includes several Ajax JSP tags,"
> > > > > 5- The "Ajax JSP tags" link above will redirect to
> > > > > http://struts.apache.org/release/2.3.x/docs/ajax-tags.html, which is
> > > > > deprecated!!
> > > > >
> > > > > I don't get it !
> > > > > Can we use AJAX Jsp tags or they are deprecated ?
> > > > >
> > > > >
> > > > > ~Regards,
> > > > > ~~Alireza Fattahi
> > > > >
> > > >
> > >
> >
 		 	   		  

Re: AJAX Jsp tags

Posted by Alireza Fattahi <af...@yahoo.com>.
Thanks for you comments !!

I have a question about tiles. I used tiles a lot in normal NON-AJAX base sites.
Now I am designing a new fully ajax base site. 
My question is why should I use tiles! The code which contains the base layout is written once. 
Consider below layout
----------------------------------------------------------------
|                                                                            |
|           Header                                                       |
|                                                                            |
----------------------------------------------------------------
----------------------------------------------------------------
|                                                                            |
| Menu1    Menu2  Menu3                                       | 
|                                                                            |
----------------------------------------------------------------

|                                                                            |

|                                                                            |
|                                                                            |
|             Page content                                           |
|                                                                            |
|                                                                            |
|                                                                            |
|                                                                            |
----------------------------------------------------------------
|                                                                            |
|           FOOTER                                                  |
|                                                                            |
----------------------------------------------------------------


There will be a HomePage.jsp, which will have the structure of above above layout Menus, PageContent, Footer. The HomePage.jsp will have all the DIVs to layout the page. Then there will be a DIV for page conetent which will be changed when users click the menu.

So, when user clicks the menu1 link the Ajax will replace the page content with page1.jsp. And all the remaining part of the page will not reload from server!
The page1.jsp will only have the required content of page1, it will not have any header, menu and footer.

I though that with Ajax technology there we will not required to use tiles any more.  


~Regards,
~~Alireza Fattahi


________________________________
 From: Chris Pratt <th...@gmail.com>
To: Struts Users Mailing List <us...@struts.apache.org> 
Cc: Alireza Fattahi <af...@yahoo.com> 
Sent: Monday, 12 August 2013, 10:50
Subject: Re: AJAX Jsp tags
 

Excellent post Ken.  I absolutely agree with everything you mention.  I too
use jQuery and jQuery UI directly in my JSP templates (not through some tag
library) and find it easier and more powerful.  I can also throw in a +1
for Tiles as a compositing technology that is indispensable in large sites.
  (*Chris*)


On Sun, Aug 11, 2013 at 10:26 PM, Ken McWilliams
<ke...@gmail.com>wrote:

> I have some experience creating custom struts2 tags, but for ajax I do not
> advise this route at all.  XML is not meant as a replacement for a
> programming language, it is meant for configuration. It might seem
> intuitive without further investigation that there are a limited number of
> HTML UI elements and their functionality quite straight forward and so it
> would seem reasonable that a configuration only route could work in the
> general case. This is wrong as evidenced by all efforts to define dynamic
> UI elements using XML.
>
> Even JavaFX tried to use xml and that was abandoned, they had the benefit
> of designing the entire environment from the ground up, which is hardly the
> case here.
>
> Not sure if you are familiar with the popular Question and Answer site
> "Stack Overflow", however a great many questions regarding the struts2 ajax
> tags go unanswered. If people could find solutions for their configuration
> issues I wouldn't be so open with my negative view of ajax tags. Since it
> is most often new users of Struts2 that attempt to use these tags and to
> what appears to be dismal results I can't help but think that these tags
> may actually be of harm to the struts2 image.
>
> I've only experimented with the jquery ajax tags breifly and experienced
> frustration. Also before that experimented with the now deprecated dojo
> tags. I had used the dojo tags within their prescribed limits but it is
> much more enjoyable to have freedom. They were just too cumbersome. As soon
> as you use JavaScript everything is far easier.
>
> Try to use Unobtrusive JavaScript:
> http://en.wikipedia.org/wiki/Unobtrusive_JavaScript
>
> This will make your html "tag like" while allowing you to use the
> JavaScript APIs as intended.
>
> It is worth noting that the tag libraries can be used as templates. I bring
> this up because one natural objection to not using a tag library would be a
> loss in terms of this particular use. There are a number of other solutions
> in this area one of them is Apache Tiles. JSPs, Freemarker, and Velocity
> are all view technologies and while they have facilities for templates it
> isn't their first concern. Apache tiles and Sitemesh both address the issue
> of reducing boiler plate head on. Tiles does not try to do what the
> aforementioned view technologies do, instead think of it as a way to factor
> commonality out of any of those view technologies. As such both Apache
> Tiles is a meta-view technology.
>
> What I advise:
>
> 1) Avoid ajax tag libraries and write JavaScript by hand - even if you
> don't know JS, you will be able to understand the documentation of the
> popular JS UI elements and achieve the same level of functionality as
> provided by the ajax tags even if all you do is cut and paste programming.
> 2) Follow the Unobtrusive JavaScript practice.
> 3) When writing JS do not hard code URLs use the struts2 URL tag (It will
> pick up changes to the context root that way).
> 4) When asking for help with the client side, no one needs to know what
> server side technology is used. The is greatly improve your chances for
> positive feedback.
> 5) Use the Struts2-JSON plugin to produce data for your ajax consuming UI
> elements and also as a means of accepting JSON data into actions.
> 6) When asking for server side support, try to insulate the audience from
> your particular JS. (Determine that the correct data is being sent to the
> server, if it not the issue is a client side, if the correct data is being
> sent only provide that data [the query string or the JSON string]).
> 7) Use firebug plugin fore Firefox, it is a huge help.
> ------------
> 8) Should you feel the need for a stronger templates solution consider
> tiles (or sitemesh), this link points to it in a rather current use of it:
> http://tech.finn.no/2012/07/25/the-ultimate-view-tiles-3/
>
> Hope the reasoning is clear enough. I sincerely want to save you and anyone
> else with similar concern some time and sanity.
>
>
>
>
>
> On Sat, Aug 10, 2013 at 3:05 AM, Alireza Fattahi <af...@yahoo.com>
> wrote:
>
> > Thanks for your comment.
> > Did you have any experience with struts jquery tag or other tags too?
> > Or you complete suggest that we write our own tags !
> >
> >
> >
> > ~Regards,
> > ~~Alireza Fattahi
> >
> >
> > ________________________________
> >  From: Ken McWilliams <ke...@gmail.com>
> > To: Struts Users Mailing List <us...@struts.apache.org>
> > Sent: Friday, 9 August 2013, 8:22
> > Subject: Re: AJAX Jsp tags
> >
> >
> > Don't use a JSP AJAX tag library. The dojo JSP tags didn't work well not
> > because of dojo or an fault of the tag authors, the technologies simply
> > don't mesh. It's as sane to program Java via XML as it is to program
> > JavaScript via XML.
> >
> > XML is used for configuration. At first glance you think you'll only need
> > trivial behaviour but this is seldom ever the case,  JS UI components are
> > much easier to work with and you will need to provide your own handlers,
> > which are often required even in the simple cases. XML can not account
> for
> > all these cases and does not provides the means to add custom handlers
> in a
> > way that would be as simple as using the underlying JS framework
> naturally.
> >
> > Further the tag authors often lag behind the UI components that they
> wrap,
> > the documentation and features often fall behind too.
> >
> > With even a trivial understanding of JS you should be able to produce the
> > same results as the Tags in the same time frame, as you gain experience
> > you'll quickly superseded the capabilities of any tag library.
> >
> >
> >
> >
> >
> > On Thu, Aug 8, 2013 at 11:02 AM, Chris Pratt <thechrispratt@gmail.com
> > >wrote:
> >
> > > The dojo based tags are deprecated, the jQuery based tags are not.
> > >   (*Chris*)
> > >
> > >
> > > On Thu, Aug 8, 2013 at 9:54 AM, Alireza Fattahi <af...@yahoo.com>
> > > wrote:
> > >
> > > > Hi,
> > > >
> > > > I have confused with struts 2 ajax please correct me:
> > > > 1- The dojo plugin is deprecated (
> > > > http://struts.apache.org/release/2.3.x/docs/ajax-tags.html)
> > > > 2- According to above we are not recommended to use dojo plugin in
> new
> > > > projects.
> > > >  3- All tags that mentioned in above page like: a, autocompliter,bind
> > ...
> > > > shall not be used.
> > > > 4- According to page
> > > http://struts.apache.org/release/2.3.x/docs/ajax.html
> > > > :
> > > > "....First, you can use some type of JSP tag. Here, you don't have to
> > > know
> > > > very much at all about Ajax or JavaScript. The taglib does all the
> > work,
> > > > and you just have to figure out how to use the taglib. The standard
> > > > Struts 2 taglib includes several Ajax JSP tags,"
> > > > 5- The "Ajax JSP tags" link above will redirect to
> > > > http://struts.apache.org/release/2.3.x/docs/ajax-tags.html, which is
> > > > deprecated!!
> > > >
> > > > I don't get it !
> > > > Can we use AJAX Jsp tags or they are deprecated ?
> > > >
> > > >
> > > > ~Regards,
> > > > ~~Alireza Fattahi
> > > >
> > >
> >
>

Re: AJAX Jsp tags

Posted by Chris Pratt <th...@gmail.com>.
Excellent post Ken.  I absolutely agree with everything you mention.  I too
use jQuery and jQuery UI directly in my JSP templates (not through some tag
library) and find it easier and more powerful.  I can also throw in a +1
for Tiles as a compositing technology that is indispensable in large sites.
  (*Chris*)


On Sun, Aug 11, 2013 at 10:26 PM, Ken McWilliams
<ke...@gmail.com>wrote:

> I have some experience creating custom struts2 tags, but for ajax I do not
> advise this route at all.  XML is not meant as a replacement for a
> programming language, it is meant for configuration. It might seem
> intuitive without further investigation that there are a limited number of
> HTML UI elements and their functionality quite straight forward and so it
> would seem reasonable that a configuration only route could work in the
> general case. This is wrong as evidenced by all efforts to define dynamic
> UI elements using XML.
>
> Even JavaFX tried to use xml and that was abandoned, they had the benefit
> of designing the entire environment from the ground up, which is hardly the
> case here.
>
> Not sure if you are familiar with the popular Question and Answer site
> "Stack Overflow", however a great many questions regarding the struts2 ajax
> tags go unanswered. If people could find solutions for their configuration
> issues I wouldn't be so open with my negative view of ajax tags. Since it
> is most often new users of Struts2 that attempt to use these tags and to
> what appears to be dismal results I can't help but think that these tags
> may actually be of harm to the struts2 image.
>
> I've only experimented with the jquery ajax tags breifly and experienced
> frustration. Also before that experimented with the now deprecated dojo
> tags. I had used the dojo tags within their prescribed limits but it is
> much more enjoyable to have freedom. They were just too cumbersome. As soon
> as you use JavaScript everything is far easier.
>
> Try to use Unobtrusive JavaScript:
> http://en.wikipedia.org/wiki/Unobtrusive_JavaScript
>
> This will make your html "tag like" while allowing you to use the
> JavaScript APIs as intended.
>
> It is worth noting that the tag libraries can be used as templates. I bring
> this up because one natural objection to not using a tag library would be a
> loss in terms of this particular use. There are a number of other solutions
> in this area one of them is Apache Tiles. JSPs, Freemarker, and Velocity
> are all view technologies and while they have facilities for templates it
> isn't their first concern. Apache tiles and Sitemesh both address the issue
> of reducing boiler plate head on. Tiles does not try to do what the
> aforementioned view technologies do, instead think of it as a way to factor
> commonality out of any of those view technologies. As such both Apache
> Tiles is a meta-view technology.
>
> What I advise:
>
> 1) Avoid ajax tag libraries and write JavaScript by hand - even if you
> don't know JS, you will be able to understand the documentation of the
> popular JS UI elements and achieve the same level of functionality as
> provided by the ajax tags even if all you do is cut and paste programming.
> 2) Follow the Unobtrusive JavaScript practice.
> 3) When writing JS do not hard code URLs use the struts2 URL tag (It will
> pick up changes to the context root that way).
> 4) When asking for help with the client side, no one needs to know what
> server side technology is used. The is greatly improve your chances for
> positive feedback.
> 5) Use the Struts2-JSON plugin to produce data for your ajax consuming UI
> elements and also as a means of accepting JSON data into actions.
> 6) When asking for server side support, try to insulate the audience from
> your particular JS. (Determine that the correct data is being sent to the
> server, if it not the issue is a client side, if the correct data is being
> sent only provide that data [the query string or the JSON string]).
> 7) Use firebug plugin fore Firefox, it is a huge help.
> ------------
> 8) Should you feel the need for a stronger templates solution consider
> tiles (or sitemesh), this link points to it in a rather current use of it:
> http://tech.finn.no/2012/07/25/the-ultimate-view-tiles-3/
>
> Hope the reasoning is clear enough. I sincerely want to save you and anyone
> else with similar concern some time and sanity.
>
>
>
>
>
> On Sat, Aug 10, 2013 at 3:05 AM, Alireza Fattahi <af...@yahoo.com>
> wrote:
>
> > Thanks for your comment.
> > Did you have any experience with struts jquery tag or other tags too?
> > Or you complete suggest that we write our own tags !
> >
> >
> >
> > ~Regards,
> > ~~Alireza Fattahi
> >
> >
> > ________________________________
> >  From: Ken McWilliams <ke...@gmail.com>
> > To: Struts Users Mailing List <us...@struts.apache.org>
> > Sent: Friday, 9 August 2013, 8:22
> > Subject: Re: AJAX Jsp tags
> >
> >
> > Don't use a JSP AJAX tag library. The dojo JSP tags didn't work well not
> > because of dojo or an fault of the tag authors, the technologies simply
> > don't mesh. It's as sane to program Java via XML as it is to program
> > JavaScript via XML.
> >
> > XML is used for configuration. At first glance you think you'll only need
> > trivial behaviour but this is seldom ever the case,  JS UI components are
> > much easier to work with and you will need to provide your own handlers,
> > which are often required even in the simple cases. XML can not account
> for
> > all these cases and does not provides the means to add custom handlers
> in a
> > way that would be as simple as using the underlying JS framework
> naturally.
> >
> > Further the tag authors often lag behind the UI components that they
> wrap,
> > the documentation and features often fall behind too.
> >
> > With even a trivial understanding of JS you should be able to produce the
> > same results as the Tags in the same time frame, as you gain experience
> > you'll quickly superseded the capabilities of any tag library.
> >
> >
> >
> >
> >
> > On Thu, Aug 8, 2013 at 11:02 AM, Chris Pratt <thechrispratt@gmail.com
> > >wrote:
> >
> > > The dojo based tags are deprecated, the jQuery based tags are not.
> > >   (*Chris*)
> > >
> > >
> > > On Thu, Aug 8, 2013 at 9:54 AM, Alireza Fattahi <af...@yahoo.com>
> > > wrote:
> > >
> > > > Hi,
> > > >
> > > > I have confused with struts 2 ajax please correct me:
> > > > 1- The dojo plugin is deprecated (
> > > > http://struts.apache.org/release/2.3.x/docs/ajax-tags.html)
> > > > 2- According to above we are not recommended to use dojo plugin in
> new
> > > > projects.
> > > >  3- All tags that mentioned in above page like: a, autocompliter,bind
> > ...
> > > > shall not be used.
> > > > 4- According to page
> > > http://struts.apache.org/release/2.3.x/docs/ajax.html
> > > > :
> > > > "....First, you can use some type of JSP tag. Here, you don't have to
> > > know
> > > > very much at all about Ajax or JavaScript. The taglib does all the
> > work,
> > > > and you just have to figure out how to use the taglib. The standard
> > > > Struts 2 taglib includes several Ajax JSP tags,"
> > > > 5- The "Ajax JSP tags" link above will redirect to
> > > > http://struts.apache.org/release/2.3.x/docs/ajax-tags.html, which is
> > > > deprecated!!
> > > >
> > > > I don't get it !
> > > > Can we use AJAX Jsp tags or they are deprecated ?
> > > >
> > > >
> > > > ~Regards,
> > > > ~~Alireza Fattahi
> > > >
> > >
> >
>

Re: AJAX Jsp tags

Posted by Ken McWilliams <ke...@gmail.com>.
I have some experience creating custom struts2 tags, but for ajax I do not
advise this route at all.  XML is not meant as a replacement for a
programming language, it is meant for configuration. It might seem
intuitive without further investigation that there are a limited number of
HTML UI elements and their functionality quite straight forward and so it
would seem reasonable that a configuration only route could work in the
general case. This is wrong as evidenced by all efforts to define dynamic
UI elements using XML.

Even JavaFX tried to use xml and that was abandoned, they had the benefit
of designing the entire environment from the ground up, which is hardly the
case here.

Not sure if you are familiar with the popular Question and Answer site
"Stack Overflow", however a great many questions regarding the struts2 ajax
tags go unanswered. If people could find solutions for their configuration
issues I wouldn't be so open with my negative view of ajax tags. Since it
is most often new users of Struts2 that attempt to use these tags and to
what appears to be dismal results I can't help but think that these tags
may actually be of harm to the struts2 image.

I've only experimented with the jquery ajax tags breifly and experienced
frustration. Also before that experimented with the now deprecated dojo
tags. I had used the dojo tags within their prescribed limits but it is
much more enjoyable to have freedom. They were just too cumbersome. As soon
as you use JavaScript everything is far easier.

Try to use Unobtrusive JavaScript:
http://en.wikipedia.org/wiki/Unobtrusive_JavaScript

This will make your html "tag like" while allowing you to use the
JavaScript APIs as intended.

It is worth noting that the tag libraries can be used as templates. I bring
this up because one natural objection to not using a tag library would be a
loss in terms of this particular use. There are a number of other solutions
in this area one of them is Apache Tiles. JSPs, Freemarker, and Velocity
are all view technologies and while they have facilities for templates it
isn't their first concern. Apache tiles and Sitemesh both address the issue
of reducing boiler plate head on. Tiles does not try to do what the
aforementioned view technologies do, instead think of it as a way to factor
commonality out of any of those view technologies. As such both Apache
Tiles is a meta-view technology.

What I advise:

1) Avoid ajax tag libraries and write JavaScript by hand - even if you
don't know JS, you will be able to understand the documentation of the
popular JS UI elements and achieve the same level of functionality as
provided by the ajax tags even if all you do is cut and paste programming.
2) Follow the Unobtrusive JavaScript practice.
3) When writing JS do not hard code URLs use the struts2 URL tag (It will
pick up changes to the context root that way).
4) When asking for help with the client side, no one needs to know what
server side technology is used. The is greatly improve your chances for
positive feedback.
5) Use the Struts2-JSON plugin to produce data for your ajax consuming UI
elements and also as a means of accepting JSON data into actions.
6) When asking for server side support, try to insulate the audience from
your particular JS. (Determine that the correct data is being sent to the
server, if it not the issue is a client side, if the correct data is being
sent only provide that data [the query string or the JSON string]).
7) Use firebug plugin fore Firefox, it is a huge help.
------------
8) Should you feel the need for a stronger templates solution consider
tiles (or sitemesh), this link points to it in a rather current use of it:
http://tech.finn.no/2012/07/25/the-ultimate-view-tiles-3/

Hope the reasoning is clear enough. I sincerely want to save you and anyone
else with similar concern some time and sanity.





On Sat, Aug 10, 2013 at 3:05 AM, Alireza Fattahi <af...@yahoo.com> wrote:

> Thanks for your comment.
> Did you have any experience with struts jquery tag or other tags too?
> Or you complete suggest that we write our own tags !
>
>
>
> ~Regards,
> ~~Alireza Fattahi
>
>
> ________________________________
>  From: Ken McWilliams <ke...@gmail.com>
> To: Struts Users Mailing List <us...@struts.apache.org>
> Sent: Friday, 9 August 2013, 8:22
> Subject: Re: AJAX Jsp tags
>
>
> Don't use a JSP AJAX tag library. The dojo JSP tags didn't work well not
> because of dojo or an fault of the tag authors, the technologies simply
> don't mesh. It's as sane to program Java via XML as it is to program
> JavaScript via XML.
>
> XML is used for configuration. At first glance you think you'll only need
> trivial behaviour but this is seldom ever the case,  JS UI components are
> much easier to work with and you will need to provide your own handlers,
> which are often required even in the simple cases. XML can not account for
> all these cases and does not provides the means to add custom handlers in a
> way that would be as simple as using the underlying JS framework naturally.
>
> Further the tag authors often lag behind the UI components that they wrap,
> the documentation and features often fall behind too.
>
> With even a trivial understanding of JS you should be able to produce the
> same results as the Tags in the same time frame, as you gain experience
> you'll quickly superseded the capabilities of any tag library.
>
>
>
>
>
> On Thu, Aug 8, 2013 at 11:02 AM, Chris Pratt <thechrispratt@gmail.com
> >wrote:
>
> > The dojo based tags are deprecated, the jQuery based tags are not.
> >   (*Chris*)
> >
> >
> > On Thu, Aug 8, 2013 at 9:54 AM, Alireza Fattahi <af...@yahoo.com>
> > wrote:
> >
> > > Hi,
> > >
> > > I have confused with struts 2 ajax please correct me:
> > > 1- The dojo plugin is deprecated (
> > > http://struts.apache.org/release/2.3.x/docs/ajax-tags.html)
> > > 2- According to above we are not recommended to use dojo plugin in new
> > > projects.
> > >  3- All tags that mentioned in above page like: a, autocompliter,bind
> ...
> > > shall not be used.
> > > 4- According to page
> > http://struts.apache.org/release/2.3.x/docs/ajax.html
> > > :
> > > "....First, you can use some type of JSP tag. Here, you don't have to
> > know
> > > very much at all about Ajax or JavaScript. The taglib does all the
> work,
> > > and you just have to figure out how to use the taglib. The standard
> > > Struts 2 taglib includes several Ajax JSP tags,"
> > > 5- The "Ajax JSP tags" link above will redirect to
> > > http://struts.apache.org/release/2.3.x/docs/ajax-tags.html, which is
> > > deprecated!!
> > >
> > > I don't get it !
> > > Can we use AJAX Jsp tags or they are deprecated ?
> > >
> > >
> > > ~Regards,
> > > ~~Alireza Fattahi
> > >
> >
>

Re: AJAX Jsp tags

Posted by Alireza Fattahi <af...@yahoo.com>.
Thanks for your comment.
Did you have any experience with struts jquery tag or other tags too?
Or you complete suggest that we write our own tags !


 
~Regards,
~~Alireza Fattahi


________________________________
 From: Ken McWilliams <ke...@gmail.com>
To: Struts Users Mailing List <us...@struts.apache.org> 
Sent: Friday, 9 August 2013, 8:22
Subject: Re: AJAX Jsp tags
 

Don't use a JSP AJAX tag library. The dojo JSP tags didn't work well not
because of dojo or an fault of the tag authors, the technologies simply
don't mesh. It's as sane to program Java via XML as it is to program
JavaScript via XML.

XML is used for configuration. At first glance you think you'll only need
trivial behaviour but this is seldom ever the case,  JS UI components are
much easier to work with and you will need to provide your own handlers,
which are often required even in the simple cases. XML can not account for
all these cases and does not provides the means to add custom handlers in a
way that would be as simple as using the underlying JS framework naturally.

Further the tag authors often lag behind the UI components that they wrap,
the documentation and features often fall behind too.

With even a trivial understanding of JS you should be able to produce the
same results as the Tags in the same time frame, as you gain experience
you'll quickly superseded the capabilities of any tag library.





On Thu, Aug 8, 2013 at 11:02 AM, Chris Pratt <th...@gmail.com>wrote:

> The dojo based tags are deprecated, the jQuery based tags are not.
>   (*Chris*)
>
>
> On Thu, Aug 8, 2013 at 9:54 AM, Alireza Fattahi <af...@yahoo.com>
> wrote:
>
> > Hi,
> >
> > I have confused with struts 2 ajax please correct me:
> > 1- The dojo plugin is deprecated (
> > http://struts.apache.org/release/2.3.x/docs/ajax-tags.html)
> > 2- According to above we are not recommended to use dojo plugin in new
> > projects.
> >  3- All tags that mentioned in above page like: a, autocompliter,bind ...
> > shall not be used.
> > 4- According to page
> http://struts.apache.org/release/2.3.x/docs/ajax.html
> > :
> > "....First, you can use some type of JSP tag. Here, you don't have to
> know
> > very much at all about Ajax or JavaScript. The taglib does all the work,
> > and you just have to figure out how to use the taglib. The standard
> > Struts 2 taglib includes several Ajax JSP tags,"
> > 5- The "Ajax JSP tags" link above will redirect to
> > http://struts.apache.org/release/2.3.x/docs/ajax-tags.html, which is
> > deprecated!!
> >
> > I don't get it !
> > Can we use AJAX Jsp tags or they are deprecated ?
> >
> >
> > ~Regards,
> > ~~Alireza Fattahi
> >
>

Re: AJAX Jsp tags

Posted by Ken McWilliams <ke...@gmail.com>.
Don't use a JSP AJAX tag library. The dojo JSP tags didn't work well not
because of dojo or an fault of the tag authors, the technologies simply
don't mesh. It's as sane to program Java via XML as it is to program
JavaScript via XML.

XML is used for configuration. At first glance you think you'll only need
trivial behaviour but this is seldom ever the case,  JS UI components are
much easier to work with and you will need to provide your own handlers,
which are often required even in the simple cases. XML can not account for
all these cases and does not provides the means to add custom handlers in a
way that would be as simple as using the underlying JS framework naturally.

Further the tag authors often lag behind the UI components that they wrap,
the documentation and features often fall behind too.

With even a trivial understanding of JS you should be able to produce the
same results as the Tags in the same time frame, as you gain experience
you'll quickly superseded the capabilities of any tag library.





On Thu, Aug 8, 2013 at 11:02 AM, Chris Pratt <th...@gmail.com>wrote:

> The dojo based tags are deprecated, the jQuery based tags are not.
>   (*Chris*)
>
>
> On Thu, Aug 8, 2013 at 9:54 AM, Alireza Fattahi <af...@yahoo.com>
> wrote:
>
> > Hi,
> >
> > I have confused with struts 2 ajax please correct me:
> > 1- The dojo plugin is deprecated (
> > http://struts.apache.org/release/2.3.x/docs/ajax-tags.html)
> > 2- According to above we are not recommended to use dojo plugin in new
> > projects.
> >  3- All tags that mentioned in above page like: a, autocompliter,bind ...
> > shall not be used.
> > 4- According to page
> http://struts.apache.org/release/2.3.x/docs/ajax.html
> > :
> > "....First, you can use some type of JSP tag. Here, you don't have to
> know
> > very much at all about Ajax or JavaScript. The taglib does all the work,
> > and you just have to figure out how to use the taglib. The standard
> > Struts 2 taglib includes several Ajax JSP tags,"
> > 5- The "Ajax JSP tags" link above will redirect to
> > http://struts.apache.org/release/2.3.x/docs/ajax-tags.html, which is
> > deprecated!!
> >
> > I don't get it !
> > Can we use AJAX Jsp tags or they are deprecated ?
> >
> >
> > ~Regards,
> > ~~Alireza Fattahi
> >
>

Re: AJAX Jsp tags

Posted by Chris Pratt <th...@gmail.com>.
The dojo based tags are deprecated, the jQuery based tags are not.
  (*Chris*)


On Thu, Aug 8, 2013 at 9:54 AM, Alireza Fattahi <af...@yahoo.com> wrote:

> Hi,
>
> I have confused with struts 2 ajax please correct me:
> 1- The dojo plugin is deprecated (
> http://struts.apache.org/release/2.3.x/docs/ajax-tags.html)
> 2- According to above we are not recommended to use dojo plugin in new
> projects.
>  3- All tags that mentioned in above page like: a, autocompliter,bind ...
> shall not be used.
> 4- According to page http://struts.apache.org/release/2.3.x/docs/ajax.html
> :
> "....First, you can use some type of JSP tag. Here, you don't have to know
> very much at all about Ajax or JavaScript. The taglib does all the work,
> and you just have to figure out how to use the taglib. The standard
> Struts 2 taglib includes several Ajax JSP tags,"
> 5- The "Ajax JSP tags" link above will redirect to
> http://struts.apache.org/release/2.3.x/docs/ajax-tags.html, which is
> deprecated!!
>
> I don't get it !
> Can we use AJAX Jsp tags or they are deprecated ?
>
>
> ~Regards,
> ~~Alireza Fattahi
>

AJAX Jsp tags

Posted by Alireza Fattahi <af...@yahoo.com>.
Hi,

I have confused with struts 2 ajax please correct me:
1- The dojo plugin is deprecated (http://struts.apache.org/release/2.3.x/docs/ajax-tags.html)
2- According to above we are not recommended to use dojo plugin in new projects.
 3- All tags that mentioned in above page like: a, autocompliter,bind ... shall not be used.
4- According to page http://struts.apache.org/release/2.3.x/docs/ajax.html:
"....First, you can use some type of JSP tag. Here, you don't have to know 
very much at all about Ajax or JavaScript. The taglib does all the work, and you just have to figure out how to use the taglib. The standard 
Struts 2 taglib includes several Ajax JSP tags,"
5- The "Ajax JSP tags" link above will redirect to http://struts.apache.org/release/2.3.x/docs/ajax-tags.html, which is deprecated!!

I don't get it !
Can we use AJAX Jsp tags or they are deprecated ? 


~Regards,
~~Alireza Fattahi

Re: struts 1 to struts2 migration.

Posted by "Sreekanth S. Nair" <sr...@egovernments.org>.
I'm sorry about that, in my migration i never tried to do patches on
existing jsp but rewriting the whole jsp. Advise if you take more days but
better do it gud migration ;) .
And i guess ur problem can be solved by
<%
OgnlValueStack valStack = (OgnlValueStack)TagUtils.getStack(pageContext);
BeanClass x = (BeanClass)valStack.findValue("x");
%>

I'm unsure about if there is any other better way. if so, you can expect
answers from experts like Lukasz.


-- 
Thanks & Regards
Srikanth


On Thu, Aug 8, 2013 at 4:44 PM, Arpan <ar...@gmail.com> wrote:

> Thanks Srikanth,
>
> But what about this problem :
> Such as
>
> In struts 1 JSP I have used <bean:define id="x" type="BeanClass"
> name="FormName" />
> In JSP scriplet there are many places we used <% String s = x.getName(); %>
>
> In struts 2 we can write <s:bean name="BeanClass" var="x"/>
>
> Now how can I use the "x" object in scriplet. As there are many references
> of "x" already written, I don't want to change so much code for now. Hence
> like to use scriplet only.
>
>
> On Thu, Aug 8, 2013 at 3:04 PM, Sreekanth S. Nair <
> sreekanth.nair@egovernments.org> wrote:
>
> > Already suggested by Lukasz, i can see thats only possible way if you
> don't
> > want to disturb the existing code much. But from my personal experience i
> > can say customizing things will make more complicated when strust2
> changes
> > its internal. We were facing so many issues while we started migration.
> We
> > also had the same kind of situation, like we used to call methods using
> > actionName!methodName or by using s:submit and specifying method
> attribute
> > (Now these are leading to big OGNL warnings) due to security updates done
> > by struts2 team. In my personal opinion better follow what strust2
> > suggested way of implementing it (with help of plugins like conventional,
> > jquery, etc u can make life easier).
> >
> > --
> > Thanks & Regards
> > Srikanth
> >
> >
> > On Thu, Aug 8, 2013 at 2:32 PM, Arpan <ar...@gmail.com> wrote:
> >
> > > Hi Sreekanth,
> > >
> > > We are also planning to do this similar way. In the meanwhile do you
> have
> > > any suggestion or solution for the problems I mentioned.
> > >
> > > Thank you..
> > >
> > >
> > > On Thu, Aug 8, 2013 at 11:30 AM, Sreekanth S. Nair <
> > > sreekanth.nair@egovernments.org> wrote:
> > >
> > > > Hi Arpan,
> > > >                We too did a struts1 to strust2 migration in recent
> > past,
> > > > its not so easy to migrate as it is. Since Struts2 gives more
> > importance
> > > to
> > > > security nowadays its always advisable to learn the correct
> > > implementation
> > > > from struts2 doc and migrate your struts1 actions one by one. Strust2
> > and
> > > > struts1 can co-exist inside same application till you migrate it
> fully.
> > > >
> > > >
> > > >
> > > > --
> > > > Thanks & Regards
> > > > Srikanth
> > > >
> > > >
> > > > On Wed, Aug 7, 2013 at 9:45 PM, Arpan <ar...@gmail.com>
> wrote:
> > > >
> > > > > Thank you so much Lukasz.. While migrating I found few more
> problems.
> > > > Such
> > > > > as
> > > > >
> > > > > In struts 1 JSP I have used <bean:define id="x" type="BeanClass"
> > > > > name="FormName" />
> > > > > In scriplet there are many places we used <% String s =
> x.getName();
> > %>
> > > > >
> > > > > In struts 2 we can write <s:bean name="BeanClass" var="x"/>
> > > > >
> > > > > Now how can I use the "x" object in scriplet. As there are many
> > > > references
> > > > > of "x" already written, I don't want to change so much code for
> now.
> > > > Hence
> > > > > like to use scriplet only.
> > > > >
> > > > > Thanks
> > > > >
> > > > >
> > > > > On Wed, Aug 7, 2013 at 7:34 PM, Lukasz Lenart <
> > lukaszlenart@apache.org
> > > > > >wrote:
> > > > >
> > > > > > You can try to write your own ActionMapper which will extract
> > request
> > > > > > parameter "action" and base on that lookup for action.
> > > > > >
> > > > > > 2013/8/7 Arpan <ar...@gmail.com>:
> > > > > > > Anybody to help here...
> > > > > > >
> > > > > > > Thanks in Advance.
> > > > > > >
> > > > > > >
> > > > > > > On Tue, Aug 6, 2013 at 7:43 PM, Arpan <ar...@gmail.com>
> > > > wrote:
> > > > > > >
> > > > > > >> Hi All,
> > > > > > >>
> > > > > > >> We are migrating from struts1 to struts2.
> > > > > > >>
> > > > > > >> In our pages we have multiple buttons which through struts1
> > > > > > DispatchAction
> > > > > > >> can be guided  to different methods in Action class. For that
> we
> > > > need
> > > > > > >> minimal changes. Such as
> > > > > > >>  In action mapping if we add parameter="action" and in JSP if
> > the
> > > > URL
> > > > > is
> > > > > > >> like x.do?action=method1, it happily directs the control to
> > > method1
> > > > in
> > > > > > >> Action class.
> > > > > > >>
> > > > > > >> I got the bellow link for struts2, but for that also we need
> > much
> > > > > > changes
> > > > > > >> to be done.
> > > > > > >>
> > > > > >
> > > > >
> > > >
> > >
> >
> http://struts.apache.org/development/2.x/docs/multiple-submit-buttons.html
> > > > > > >>
> > > > > > >> Is there any such way we do similar functionality in struts2
> > with
> > > > > > minimal
> > > > > > >> changes.
> > > > > > >>
> > > > > > >> Thanks
> > > > > > >>
> > > > > > >>
> > > > > > >>
> > > > > >
> > > > > >
> > ---------------------------------------------------------------------
> > > > > > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > > > > > For additional commands, e-mail: user-help@struts.apache.org
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>

Re: struts 1 to struts2 migration.

Posted by Arpan <ar...@gmail.com>.
Thanks Srikanth,

But what about this problem :
Such as

In struts 1 JSP I have used <bean:define id="x" type="BeanClass"
name="FormName" />
In JSP scriplet there are many places we used <% String s = x.getName(); %>

In struts 2 we can write <s:bean name="BeanClass" var="x"/>

Now how can I use the "x" object in scriplet. As there are many references
of "x" already written, I don't want to change so much code for now. Hence
like to use scriplet only.


On Thu, Aug 8, 2013 at 3:04 PM, Sreekanth S. Nair <
sreekanth.nair@egovernments.org> wrote:

> Already suggested by Lukasz, i can see thats only possible way if you don't
> want to disturb the existing code much. But from my personal experience i
> can say customizing things will make more complicated when strust2 changes
> its internal. We were facing so many issues while we started migration. We
> also had the same kind of situation, like we used to call methods using
> actionName!methodName or by using s:submit and specifying method attribute
> (Now these are leading to big OGNL warnings) due to security updates done
> by struts2 team. In my personal opinion better follow what strust2
> suggested way of implementing it (with help of plugins like conventional,
> jquery, etc u can make life easier).
>
> --
> Thanks & Regards
> Srikanth
>
>
> On Thu, Aug 8, 2013 at 2:32 PM, Arpan <ar...@gmail.com> wrote:
>
> > Hi Sreekanth,
> >
> > We are also planning to do this similar way. In the meanwhile do you have
> > any suggestion or solution for the problems I mentioned.
> >
> > Thank you..
> >
> >
> > On Thu, Aug 8, 2013 at 11:30 AM, Sreekanth S. Nair <
> > sreekanth.nair@egovernments.org> wrote:
> >
> > > Hi Arpan,
> > >                We too did a struts1 to strust2 migration in recent
> past,
> > > its not so easy to migrate as it is. Since Struts2 gives more
> importance
> > to
> > > security nowadays its always advisable to learn the correct
> > implementation
> > > from struts2 doc and migrate your struts1 actions one by one. Strust2
> and
> > > struts1 can co-exist inside same application till you migrate it fully.
> > >
> > >
> > >
> > > --
> > > Thanks & Regards
> > > Srikanth
> > >
> > >
> > > On Wed, Aug 7, 2013 at 9:45 PM, Arpan <ar...@gmail.com> wrote:
> > >
> > > > Thank you so much Lukasz.. While migrating I found few more problems.
> > > Such
> > > > as
> > > >
> > > > In struts 1 JSP I have used <bean:define id="x" type="BeanClass"
> > > > name="FormName" />
> > > > In scriplet there are many places we used <% String s = x.getName();
> %>
> > > >
> > > > In struts 2 we can write <s:bean name="BeanClass" var="x"/>
> > > >
> > > > Now how can I use the "x" object in scriplet. As there are many
> > > references
> > > > of "x" already written, I don't want to change so much code for now.
> > > Hence
> > > > like to use scriplet only.
> > > >
> > > > Thanks
> > > >
> > > >
> > > > On Wed, Aug 7, 2013 at 7:34 PM, Lukasz Lenart <
> lukaszlenart@apache.org
> > > > >wrote:
> > > >
> > > > > You can try to write your own ActionMapper which will extract
> request
> > > > > parameter "action" and base on that lookup for action.
> > > > >
> > > > > 2013/8/7 Arpan <ar...@gmail.com>:
> > > > > > Anybody to help here...
> > > > > >
> > > > > > Thanks in Advance.
> > > > > >
> > > > > >
> > > > > > On Tue, Aug 6, 2013 at 7:43 PM, Arpan <ar...@gmail.com>
> > > wrote:
> > > > > >
> > > > > >> Hi All,
> > > > > >>
> > > > > >> We are migrating from struts1 to struts2.
> > > > > >>
> > > > > >> In our pages we have multiple buttons which through struts1
> > > > > DispatchAction
> > > > > >> can be guided  to different methods in Action class. For that we
> > > need
> > > > > >> minimal changes. Such as
> > > > > >>  In action mapping if we add parameter="action" and in JSP if
> the
> > > URL
> > > > is
> > > > > >> like x.do?action=method1, it happily directs the control to
> > method1
> > > in
> > > > > >> Action class.
> > > > > >>
> > > > > >> I got the bellow link for struts2, but for that also we need
> much
> > > > > changes
> > > > > >> to be done.
> > > > > >>
> > > > >
> > > >
> > >
> >
> http://struts.apache.org/development/2.x/docs/multiple-submit-buttons.html
> > > > > >>
> > > > > >> Is there any such way we do similar functionality in struts2
> with
> > > > > minimal
> > > > > >> changes.
> > > > > >>
> > > > > >> Thanks
> > > > > >>
> > > > > >>
> > > > > >>
> > > > >
> > > > >
> ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > > > > For additional commands, e-mail: user-help@struts.apache.org
> > > > >
> > > > >
> > > >
> > >
> >
>

Re: struts 1 to struts2 migration.

Posted by "Sreekanth S. Nair" <sr...@egovernments.org>.
Already suggested by Lukasz, i can see thats only possible way if you don't
want to disturb the existing code much. But from my personal experience i
can say customizing things will make more complicated when strust2 changes
its internal. We were facing so many issues while we started migration. We
also had the same kind of situation, like we used to call methods using
actionName!methodName or by using s:submit and specifying method attribute
(Now these are leading to big OGNL warnings) due to security updates done
by struts2 team. In my personal opinion better follow what strust2
suggested way of implementing it (with help of plugins like conventional,
jquery, etc u can make life easier).

-- 
Thanks & Regards
Srikanth


On Thu, Aug 8, 2013 at 2:32 PM, Arpan <ar...@gmail.com> wrote:

> Hi Sreekanth,
>
> We are also planning to do this similar way. In the meanwhile do you have
> any suggestion or solution for the problems I mentioned.
>
> Thank you..
>
>
> On Thu, Aug 8, 2013 at 11:30 AM, Sreekanth S. Nair <
> sreekanth.nair@egovernments.org> wrote:
>
> > Hi Arpan,
> >                We too did a struts1 to strust2 migration in recent past,
> > its not so easy to migrate as it is. Since Struts2 gives more importance
> to
> > security nowadays its always advisable to learn the correct
> implementation
> > from struts2 doc and migrate your struts1 actions one by one. Strust2 and
> > struts1 can co-exist inside same application till you migrate it fully.
> >
> >
> >
> > --
> > Thanks & Regards
> > Srikanth
> >
> >
> > On Wed, Aug 7, 2013 at 9:45 PM, Arpan <ar...@gmail.com> wrote:
> >
> > > Thank you so much Lukasz.. While migrating I found few more problems.
> > Such
> > > as
> > >
> > > In struts 1 JSP I have used <bean:define id="x" type="BeanClass"
> > > name="FormName" />
> > > In scriplet there are many places we used <% String s = x.getName(); %>
> > >
> > > In struts 2 we can write <s:bean name="BeanClass" var="x"/>
> > >
> > > Now how can I use the "x" object in scriplet. As there are many
> > references
> > > of "x" already written, I don't want to change so much code for now.
> > Hence
> > > like to use scriplet only.
> > >
> > > Thanks
> > >
> > >
> > > On Wed, Aug 7, 2013 at 7:34 PM, Lukasz Lenart <lukaszlenart@apache.org
> > > >wrote:
> > >
> > > > You can try to write your own ActionMapper which will extract request
> > > > parameter "action" and base on that lookup for action.
> > > >
> > > > 2013/8/7 Arpan <ar...@gmail.com>:
> > > > > Anybody to help here...
> > > > >
> > > > > Thanks in Advance.
> > > > >
> > > > >
> > > > > On Tue, Aug 6, 2013 at 7:43 PM, Arpan <ar...@gmail.com>
> > wrote:
> > > > >
> > > > >> Hi All,
> > > > >>
> > > > >> We are migrating from struts1 to struts2.
> > > > >>
> > > > >> In our pages we have multiple buttons which through struts1
> > > > DispatchAction
> > > > >> can be guided  to different methods in Action class. For that we
> > need
> > > > >> minimal changes. Such as
> > > > >>  In action mapping if we add parameter="action" and in JSP if the
> > URL
> > > is
> > > > >> like x.do?action=method1, it happily directs the control to
> method1
> > in
> > > > >> Action class.
> > > > >>
> > > > >> I got the bellow link for struts2, but for that also we need much
> > > > changes
> > > > >> to be done.
> > > > >>
> > > >
> > >
> >
> http://struts.apache.org/development/2.x/docs/multiple-submit-buttons.html
> > > > >>
> > > > >> Is there any such way we do similar functionality in struts2 with
> > > > minimal
> > > > >> changes.
> > > > >>
> > > > >> Thanks
> > > > >>
> > > > >>
> > > > >>
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > > > For additional commands, e-mail: user-help@struts.apache.org
> > > >
> > > >
> > >
> >
>

Re: struts 1 to struts2 migration.

Posted by Arpan <ar...@gmail.com>.
Hi Sreekanth,

We are also planning to do this similar way. In the meanwhile do you have
any suggestion or solution for the problems I mentioned.

Thank you..


On Thu, Aug 8, 2013 at 11:30 AM, Sreekanth S. Nair <
sreekanth.nair@egovernments.org> wrote:

> Hi Arpan,
>                We too did a struts1 to strust2 migration in recent past,
> its not so easy to migrate as it is. Since Struts2 gives more importance to
> security nowadays its always advisable to learn the correct implementation
> from struts2 doc and migrate your struts1 actions one by one. Strust2 and
> struts1 can co-exist inside same application till you migrate it fully.
>
>
>
> --
> Thanks & Regards
> Srikanth
>
>
> On Wed, Aug 7, 2013 at 9:45 PM, Arpan <ar...@gmail.com> wrote:
>
> > Thank you so much Lukasz.. While migrating I found few more problems.
> Such
> > as
> >
> > In struts 1 JSP I have used <bean:define id="x" type="BeanClass"
> > name="FormName" />
> > In scriplet there are many places we used <% String s = x.getName(); %>
> >
> > In struts 2 we can write <s:bean name="BeanClass" var="x"/>
> >
> > Now how can I use the "x" object in scriplet. As there are many
> references
> > of "x" already written, I don't want to change so much code for now.
> Hence
> > like to use scriplet only.
> >
> > Thanks
> >
> >
> > On Wed, Aug 7, 2013 at 7:34 PM, Lukasz Lenart <lukaszlenart@apache.org
> > >wrote:
> >
> > > You can try to write your own ActionMapper which will extract request
> > > parameter "action" and base on that lookup for action.
> > >
> > > 2013/8/7 Arpan <ar...@gmail.com>:
> > > > Anybody to help here...
> > > >
> > > > Thanks in Advance.
> > > >
> > > >
> > > > On Tue, Aug 6, 2013 at 7:43 PM, Arpan <ar...@gmail.com>
> wrote:
> > > >
> > > >> Hi All,
> > > >>
> > > >> We are migrating from struts1 to struts2.
> > > >>
> > > >> In our pages we have multiple buttons which through struts1
> > > DispatchAction
> > > >> can be guided  to different methods in Action class. For that we
> need
> > > >> minimal changes. Such as
> > > >>  In action mapping if we add parameter="action" and in JSP if the
> URL
> > is
> > > >> like x.do?action=method1, it happily directs the control to method1
> in
> > > >> Action class.
> > > >>
> > > >> I got the bellow link for struts2, but for that also we need much
> > > changes
> > > >> to be done.
> > > >>
> > >
> >
> http://struts.apache.org/development/2.x/docs/multiple-submit-buttons.html
> > > >>
> > > >> Is there any such way we do similar functionality in struts2 with
> > > minimal
> > > >> changes.
> > > >>
> > > >> Thanks
> > > >>
> > > >>
> > > >>
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > > For additional commands, e-mail: user-help@struts.apache.org
> > >
> > >
> >
>

Re: struts 1 to struts2 migration.

Posted by "Sreekanth S. Nair" <sr...@egovernments.org>.
Hi Arpan,
               We too did a struts1 to strust2 migration in recent past,
its not so easy to migrate as it is. Since Struts2 gives more importance to
security nowadays its always advisable to learn the correct implementation
from struts2 doc and migrate your struts1 actions one by one. Strust2 and
struts1 can co-exist inside same application till you migrate it fully.



-- 
Thanks & Regards
Srikanth


On Wed, Aug 7, 2013 at 9:45 PM, Arpan <ar...@gmail.com> wrote:

> Thank you so much Lukasz.. While migrating I found few more problems. Such
> as
>
> In struts 1 JSP I have used <bean:define id="x" type="BeanClass"
> name="FormName" />
> In scriplet there are many places we used <% String s = x.getName(); %>
>
> In struts 2 we can write <s:bean name="BeanClass" var="x"/>
>
> Now how can I use the "x" object in scriplet. As there are many references
> of "x" already written, I don't want to change so much code for now. Hence
> like to use scriplet only.
>
> Thanks
>
>
> On Wed, Aug 7, 2013 at 7:34 PM, Lukasz Lenart <lukaszlenart@apache.org
> >wrote:
>
> > You can try to write your own ActionMapper which will extract request
> > parameter "action" and base on that lookup for action.
> >
> > 2013/8/7 Arpan <ar...@gmail.com>:
> > > Anybody to help here...
> > >
> > > Thanks in Advance.
> > >
> > >
> > > On Tue, Aug 6, 2013 at 7:43 PM, Arpan <ar...@gmail.com> wrote:
> > >
> > >> Hi All,
> > >>
> > >> We are migrating from struts1 to struts2.
> > >>
> > >> In our pages we have multiple buttons which through struts1
> > DispatchAction
> > >> can be guided  to different methods in Action class. For that we need
> > >> minimal changes. Such as
> > >>  In action mapping if we add parameter="action" and in JSP if the URL
> is
> > >> like x.do?action=method1, it happily directs the control to method1 in
> > >> Action class.
> > >>
> > >> I got the bellow link for struts2, but for that also we need much
> > changes
> > >> to be done.
> > >>
> >
> http://struts.apache.org/development/2.x/docs/multiple-submit-buttons.html
> > >>
> > >> Is there any such way we do similar functionality in struts2 with
> > minimal
> > >> changes.
> > >>
> > >> Thanks
> > >>
> > >>
> > >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
>

Re: struts 1 to struts2 migration.

Posted by Arpan <ar...@gmail.com>.
Thank you so much Lukasz.. While migrating I found few more problems. Such
as

In struts 1 JSP I have used <bean:define id="x" type="BeanClass"
name="FormName" />
In scriplet there are many places we used <% String s = x.getName(); %>

In struts 2 we can write <s:bean name="BeanClass" var="x"/>

Now how can I use the "x" object in scriplet. As there are many references
of "x" already written, I don't want to change so much code for now. Hence
like to use scriplet only.

Thanks


On Wed, Aug 7, 2013 at 7:34 PM, Lukasz Lenart <lu...@apache.org>wrote:

> You can try to write your own ActionMapper which will extract request
> parameter "action" and base on that lookup for action.
>
> 2013/8/7 Arpan <ar...@gmail.com>:
> > Anybody to help here...
> >
> > Thanks in Advance.
> >
> >
> > On Tue, Aug 6, 2013 at 7:43 PM, Arpan <ar...@gmail.com> wrote:
> >
> >> Hi All,
> >>
> >> We are migrating from struts1 to struts2.
> >>
> >> In our pages we have multiple buttons which through struts1
> DispatchAction
> >> can be guided  to different methods in Action class. For that we need
> >> minimal changes. Such as
> >>  In action mapping if we add parameter="action" and in JSP if the URL is
> >> like x.do?action=method1, it happily directs the control to method1 in
> >> Action class.
> >>
> >> I got the bellow link for struts2, but for that also we need much
> changes
> >> to be done.
> >>
> http://struts.apache.org/development/2.x/docs/multiple-submit-buttons.html
> >>
> >> Is there any such way we do similar functionality in struts2 with
> minimal
> >> changes.
> >>
> >> Thanks
> >>
> >>
> >>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: struts 1 to struts2 migration.

Posted by Lukasz Lenart <lu...@apache.org>.
You can try to write your own ActionMapper which will extract request
parameter "action" and base on that lookup for action.

2013/8/7 Arpan <ar...@gmail.com>:
> Anybody to help here...
>
> Thanks in Advance.
>
>
> On Tue, Aug 6, 2013 at 7:43 PM, Arpan <ar...@gmail.com> wrote:
>
>> Hi All,
>>
>> We are migrating from struts1 to struts2.
>>
>> In our pages we have multiple buttons which through struts1 DispatchAction
>> can be guided  to different methods in Action class. For that we need
>> minimal changes. Such as
>>  In action mapping if we add parameter="action" and in JSP if the URL is
>> like x.do?action=method1, it happily directs the control to method1 in
>> Action class.
>>
>> I got the bellow link for struts2, but for that also we need much changes
>> to be done.
>> http://struts.apache.org/development/2.x/docs/multiple-submit-buttons.html
>>
>> Is there any such way we do similar functionality in struts2 with minimal
>> changes.
>>
>> Thanks
>>
>>
>>

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


Re: struts 1 to struts2 migration.

Posted by Arpan <ar...@gmail.com>.
Anybody to help here...

Thanks in Advance.


On Tue, Aug 6, 2013 at 7:43 PM, Arpan <ar...@gmail.com> wrote:

> Hi All,
>
> We are migrating from struts1 to struts2.
>
> In our pages we have multiple buttons which through struts1 DispatchAction
> can be guided  to different methods in Action class. For that we need
> minimal changes. Such as
>  In action mapping if we add parameter="action" and in JSP if the URL is
> like x.do?action=method1, it happily directs the control to method1 in
> Action class.
>
> I got the bellow link for struts2, but for that also we need much changes
> to be done.
> http://struts.apache.org/development/2.x/docs/multiple-submit-buttons.html
>
> Is there any such way we do similar functionality in struts2 with minimal
> changes.
>
> Thanks
>
>
>