Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

I encounter Errors when using struts tiles on JSP.

 
Lee chaolan
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Greetings,
i tried to use tiles and tld files on a jsp page,but i encounter an error while trying to load the jsp file.

These are the libraries i insert into the WEB-INF/lib folder
struts.jar, struts-tiles.tld, struts-nested.tld, struts-logic.tld, struts-html.tld, struts-bean.tld, struts-el.jar, struts-bean.tld, jstl.jar, c.tld, c-rt.tld

My jsp which i'm using:


The errors i encounter:



I will like to ask what have i miss or what do i need to configure to solve this error?

Thanks for the guidance
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you defined the attributes you're inserting? Are you using a Tiles request processor or otherwise initializing Tiles (IIRC it has a couple mechanisms for doing so)?
 
Lee chaolan
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok.. How do i initialise the attributes.

I'm sorry if you feel that my questions are stupid because this is the first time i'm using struts and i'm learning how to use the tiles.

Actually what i'm currently doing is after creating the header.jsp, the footer.jsp and the register.jsp for the body, i decide to dunp all 3 of them into the DefaultLayout.jsp.

So i start my jboss, and type http://localhost:8080/DefaultLayout.jsp to view the page on my browser. At this point, am i on the right track?

Thanks
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A few questions/comments:

- There are no stupid questions (for the most part ;)

- What version of Struts are you using? Are you sure you have all the necessary dependencies? The list of JAR files you include seems a little short; I'm almost positive you'll need things like commons-digester and so on.

- Do you have any tiles definition files? Have you looked at the Tiles documentation for how to use Tiles (or other resource)?

- The Struts TLD files shouldn't be in /WEB-INF/lib; they should be in the Struts jar file and you shouldn't need to reference them anywhere, assuming you're using a relatively recent version of Struts and any reasonable app server.
 
chaolan lee
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I'm using Struts 1.2.9.

i have add in a few more libraries.
commons-beanutils.jar, commons-digester.jar, commons-digester.jar, commons-logging.jar, commons-resources.jar, jakarta-oro.jar, commons-validator.jar

This is my tile-def.xml

 
Lee chaolan
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks..

i finally know whats the error. i cannot directly type the url of the page on the browser. I need to activate struts to display out the tiles.

Thanks for the help.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic