• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

Struts1 to Struts2 Migration

 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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 :
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have a look at the Tiles plugin and see if that helps.
 
hari gutta
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Joe Ess wrote:Have a look at the Tiles plugin and see if that helps.



Unfortunately it didn't help much
 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HI

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

Thanks.
 
hari gutta
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey,

I am too facing the same problem. Can you please mail me the war file @
[email protected]
 
asr chowdary
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 [email protected]

All the best.

 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic