File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes JSP Template for Email Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "JSP Template for Email" Watch "JSP Template for Email" New topic
Author

JSP Template for Email

Felix Ng
Greenhorn

Joined: Jan 04, 2006
Posts: 9
I know there is similar question before, but i really wanna to see if there is any better answer today.

We are all JSP 2.0 projects, 2.0 + EL, and we really want to reuse some JSP as our template, they are actually the same page content, just less style. My team really think there is a better way, other than:
1. Use another template engine and redo all presentation logic
2. Use URLConnection to grab the page (each page need to go through the web server)

Does anyone know anything to fake a request/response object, such that we can do a getRequestDispatcher(url).include(req, res) within our code?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39535
    
  27
JSP has jsp:include for including static content and other web resources, and the include directive (<%@ include file="..." %>) for including JSP fragments.

If you're looking for a more elaborate templating solution, have a look at SiteMesh.


Ping & DNS - updated with new look and Ping home screen widget
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

"Felix Ng",
Please check your private messages.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
wood burning stoves
 
subject: JSP Template for Email
 
Similar Threads
Is this the best way to get at dynamic data?
dynamic action attribute of a form
Element and Template Data in JSP
A JSP document template for XHTML output
Call spring bean inside JSP/struts2 bean from a JSP