aspose file tools*
The moose likes Struts and the fly likes Struts1 to Struts2 Migration Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts1 to Struts2 Migration" Watch "Struts1 to Struts2 Migration" New topic
Author

Struts1 to Struts2 Migration

hari gutta
Ranch Hand

Joined: Mar 03, 2013
Posts: 33

Hey, I am trying to migrate the entire application from Struts 1 to Struts 2, so I deleted some files like struts-tiles.tld,struts-html.tld etc.
I know that in Struts2 we have only one tld, which is present in Struts2-Core-2.X.X jar in META-INF folder. The only thing we need to do is add the jar (Go to build path -> libraries -> Add external jar), right? I assume that we don't need to extract struts-tags.tld from this jar and explicity add it to the project. Is it true?

Now my one.jsp page has the following contents,


For this I need to replace the first statement with

So how should I handle <tiles:getAsString name="breadCrumb"/> ?? Since I removed struts-tiles.tld.

Similarly if I remove struts-html.tld, then how should I handle <html:errors /> ?? (For now, I simply removed it from my JSP file)

So my two.jsp code previously is

after modification it looks like :
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8927
    
    9

Have a look at the Tiles plugin and see if that helps.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
hari gutta
Ranch Hand

Joined: Mar 03, 2013
Posts: 33
Joe Ess wrote:Have a look at the Tiles plugin and see if that helps.


Unfortunately it didn't help much
asr chowdary
Ranch Hand

Joined: Mar 14, 2013
Posts: 35

Hi

Can you go through the below links.

http://www.myjavahub.com/p/class-room-notes.html
http://javaera.com/community/threads/sathya-technologies-nataraz-advance-java-notes.768/
http://java2nataraz.blogspot.in/2013/01/notes-by-nataraj-sir.html

There you can find out all Java resources(class room note books and material), I went to his classes.You will get clear explanation.

Thanks
asr chowdary
Ranch Hand

Joined: Mar 14, 2013
Posts: 35

Step by step explanation is there, with screen shots,

visit this link also http://java2nataraz.blogspot.in/2013/01/struts-2x.html

Thanks
asr chowdary
Ranch Hand

Joined: Mar 14, 2013
Posts: 35
HI

I thought that these links are useful,If Not please ignore them.

Thanks.
hari gutta
Ranch Hand

Joined: Mar 03, 2013
Posts: 33
Suresh babua wrote:
Step by step explanation is there, with screen shots,

visit this link also http://java2nataraz.blogspot.in/2013/01/struts-2x.html

Thanks


The link was grt..Thank you..

But I tried one more example yesterday, but in that too I got the similar error which we discussed earlier.

I will look into this, and let you know the main reason why I faced that problem..

By the way, did you figure out how your 'no such action...' error was resolved??

For now, I am following this
http://www.tutorialspoint.com/struts_2/struts_actions.htm

asr chowdary
Ranch Hand

Joined: Mar 14, 2013
Posts: 35
HI

Sorry for late reply,

Thanks For Your Immediate Reply..

I will check that "No Action:" ASAP.

Do You Have any Idea on EXO Platform?? If You Know Please Help me. In My plate 70 requirements are there.I need to clean It.Its Not my Plate Unfortunately It came for me.


Thanks
hari gutta
Ranch Hand

Joined: Mar 03, 2013
Posts: 33
Suresh babua wrote:HI

Sorry for late reply,

Thanks For Your Immediate Reply..

I will check that "No Action:" ASAP.

Do You Have any Idea on EXO Platform?? If You Know Please Help me. In My plate 70 requirements are there.I need to clean It.Its Not my Plate Unfortunately It came for me.


Thanks


Sorry I don't have any idea

Wish you luck!!
asr chowdary
Ranch Hand

Joined: Mar 14, 2013
Posts: 35
Hi

Today I did three struts 2 basic applications.

2 applications in the link( http://www.tutorialspoint.com/struts_2/struts_actions.htm ) which you mentioned .

and another application with "namespace" attribute ,but I did not get any "No such Action" error.

this is my struts.xml file

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<constant name="struts.devMode" value="true" />
<package name="helloworld" namespace="/" extends="struts-default">
<action name="hello"
class="com.tutorialspoint.struts2.HelloWorldAction"
method="execute">
<result name="success">HelloWorld.jsp</result>

</action>
</package>

<package name="helloworld1" namespace="/first" extends="struts-default">
<action name="hello"
class="com.tutorialspoint.struts2.HelloWorldAction"
method="execute">
<result name="success">HelloWorld.jsp</result>
</action>
</package>


<package name="helloworld2" namespace="/second" extends="struts-default">
<action name="hello"
class="com.tutorialspoint.struts2.HelloWorldAction"
method="execute">
<result name="success">HelloWorld.jsp</result>
</action>
</package>

</struts>

with "first" "second" names, I created 2 folder along with "WEB_INF" folder and placed the jsp files inside those folders.

Please post your files,so that I can Test your Application.

These applications I did on Linux 64 bit machine with tomcat server.


Thanks

Manvi Manda
Greenhorn

Joined: May 04, 2013
Posts: 1
Hey,

I am too facing the same problem. Can you please mail me the war file @
mbmanz25@gmail.com
asr chowdary
Ranch Hand

Joined: Mar 14, 2013
Posts: 35
Hi

I sent the war file for "namespace" attribute test application and please copy the given jar file to <TomcatHome>/lib
that jar is not available in war file.

If you want I will send other war files also.My mailid just.javaworld@gmail.com

All the best.

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts1 to Struts2 Migration