File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes please help struts hibernate ---tiles framework is not working please help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "please help struts hibernate ---tiles framework is not working please help" Watch "please help struts hibernate ---tiles framework is not working please help" New topic
Author

please help struts hibernate ---tiles framework is not working please help

shan rast
Greenhorn

Joined: Jan 25, 2009
Posts: 7
new bie here
hi i am making a project on online bookstore using struts and hibernate using myeclipse i used tiles definition but its not imported in my jsp
in struts config
please help me this is not working

=============================================================
<struts-config>
<data-sources />
<form-beans>
<form-bean name="bookForm"
type="org.apache.struts.action.DynaActionForm">
<form-property name="search" type="java.lang.String" />
<form-property name="searchtype" type="java.lang.String" />
<form-property name="searchresult" type="java.util.List"></form-property>
</form-bean>
<form-bean name="adminForm"
type="org.apache.struts.action.DynaActionForm">
<form-property name="uname" type="java.lang.String" />
<form-property name="pass" type="java.lang.String" />

</form-bean>
<form-bean name="adminDeleteForm"
type="org.apache.struts.action.DynaActionForm">
<form-property name="isbnno" type="java.lang.String" />

</form-bean>
</form-beans>
<global-exceptions />
<global-forwards>

</global-forwards>
<action-mappings>
<action path="/adminlogin" forward="/adminlogin.jsp"></action>
<action path="/adminoperation" name="adminForm"
type="com.yourcompany.struts.action.adminaction.AdminAction"
input="/adminlogin.jsp" scope="request">
<forward name="adminCRUD" path="/adminCRUD.jsp" />
<forward name="adminlogin" path="/adminlogin.jsp" />
</action>


<action path="/adminInsertUpdate" forward="/adminInsertUpdate.jsp"></action>
<action path="/adminDelete" forward="/adminDelete.jsp"></action>


<action attribute="bookForm" name="bookForm" path="/book"
input="/start.jsp" scope="session"
type="com.yourcompany.struts.action.BookAction">
<forward name="booksearch" path="/booksearch.jsp" />
<forward name="start" path="/start.jsp" />
</action>
<action
attribute="adminDeleteForm"
input="/adminDelete.jsp"
name="adminDeleteForm"
path="/delete"
type="com.yourcompany.struts.action.DeleteAction">
<forward name="adminCRUD" path="/adminCRUD.jsp" />
</action>


<!-- <forward name="sendtoadmin" path="/sendit.do" />-->




</action-mappings>

<message-resources
parameter="com.yourcompany.struts.ApplicationResources" />

<plug-in className="org.apache.struts.tiles.TilesPlugin">
<set-property property="definitions-config" value="/WEB-INF/tiles-defs.xml" />
<set-property property="moduleAware" value="true" />
<set-property property="definitions-parser-validate" value="true" />
</plug-in>
=====================================================
tiles-defs.xml
well i just put the necessary code
<definition name="main.layout" path="/mainlayout.jsp">

<put name="header" value="/header.jsp" />

<put name="footer" value="/footer.jsp" />

</definition>
<definition name="start.page" extends="main.layout">
<put name="title" value="default page" />
<put name="body" value="/start.jsp" />
</definition>
<definition name="booksearch.page" extends="main.layout">
<put name="title" value="book result page" />
<put name="body" value="/booksearch.jsp" />
</definition>
================================================
start.jsp


<%@ page language="java" pageEncoding="ISO-8859-1"%>
<%@ page import="java.util.*"%>

<%@ page import="com.yourcompany.ghj.*"%>
<%@ page import="java.util.List"%>
<jsp:directive.page import="com.yourcompany.bookModel.BookSearch" />

<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean"
prefix="bean"%>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html"
prefix="html"%>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-logic"
prefix="logic"%>

<%@ taglib uri="http://jakarta.apache.org/struts/tags-tiles"
prefix="tiles"%>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-template"
prefix="template"%>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-nested"
prefix="nested"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html:html locale="true">
<head>
<html:base />

<title>start.jsp</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->

</head>

<body>
<table>
<tr>

<html:form action="book.do" > 
<html:select property="searchtype">
<htmlption value="select">select</htmlption>
<htmlption value="titlebook">title</htmlption>
<htmlption value="authorbook">author</htmlption>
<htmlption value="publisherbook">publisher</htmlption>
</html:select>
<html:text property="search"></html:text>
<html:submit>search</html:submit>
</html:form>
<td>
<html:link action="/adminlogin">admin</html:link>
</td>
</tr>
</table>



</body>

</html:html>
======================================================
in xml i put this as the index file
<welcome-file-list>
<welcome-file>start.jsp</welcome-file>
</welcome-file-list>

there are header and footer which i used but i think there is problem of path or name please help me
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Please use the "code" tags so the XML/JSP/etc. is readable.

It's unclear to me what the problem is--you're not using any tiles tags in your JSP nor referring to any tiles definitions in your struts-config file, so I'm not sure what you're expecting to happen.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: please help struts hibernate ---tiles framework is not working please help
 
Similar Threads
Problem while running a project using tiles in netbeans
Cannot Retrieve Definition for Form Bean Null
how do i use html:select to forward to different pages?
DynaValidatorActionForm not working
Struts with Tiles--- simple program but not working