struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sreekanth S. Nair" <sreekanth.n...@egovernments.org>
Subject Re: struts 1 to struts2 migration.
Date Thu, 08 Aug 2013 11:33:57 GMT
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 <arpan.debroy@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 <arpan.debroy@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 <arpan.debroy@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 <arpan.debroy@gmail.com>:
> > > > > > > Anybody to help here...
> > > > > > >
> > > > > > > Thanks in Advance.
> > > > > > >
> > > > > > >
> > > > > > > On Tue, Aug 6, 2013 at 7:43 PM, Arpan <arpan.debroy@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
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message