aspose file tools*
The moose likes Struts and the fly likes I encounter Errors when using struts tiles on JSP. 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 "I encounter Errors when using struts tiles on JSP. " Watch "I encounter Errors when using struts tiles on JSP. " New topic
Author

I encounter Errors when using struts tiles on JSP.

Lee chaolan
Greenhorn

Joined: Mar 22, 2009
Posts: 4
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

Joined: Sep 29, 2008
Posts: 12617

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

Joined: Mar 22, 2009
Posts: 4
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

Joined: Sep 29, 2008
Posts: 12617

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

Joined: Oct 15, 2008
Posts: 5
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

Joined: Mar 22, 2009
Posts: 4
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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: I encounter Errors when using struts tiles on JSP.