struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Deffenbaugh <jdeffenba...@techtarget.com>
Subject Using Objects in JSP
Date Mon, 19 Nov 2007 18:56:57 GMT
In struts 1 you could use the bean:define tag to use objects in a jsp
file... for instance I used this to show a stack trace in an error jsp.

<bean:define name="error" id="e" type="java.lang.Exception"/>
<%
	out.println("<!--");
	StringWriter sw = new StringWriter();
	PrintWriter pw = new PrintWriter(sw);
	e.printStackTrace(pw);
	out.print(sw);

	sw.close();
	pw.close();
	out.println("-->");
%>

where I had set 

catch (Exception e) {
	request.setParameter("error", e);
}

How would I accomplish this in struts 2?

Thanks!

-Jason


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message