Regards
Sachin
sachin burange wrote:configuration problem. try to put necessary things in classpath.
commons-fileupload.jar
commons-logging-1.0.4.jar
freemarker-2.3.13.jar
ognl-2.6.11.jar
struts2-convention-plugin-2.1.6.jar
struts2-core-2.1.6.jar
xwork-2.1.2.jar
David Newton wrote:I'm not sure what, exactly, you're trying to do.
FreeMarker's tag support requires the template mechanism to be run through the FreemarkerServlet (or equivalent, like an S2 "freemarker" result).
See how FreeMarker supports custom tags in the Using FreeMarker with Servlets portion of the FreeMarker manual.
David Newton wrote:I'm curious why you're doing this, though!
David Newton wrote:I'm curious why you're doing this, though!
aran tam wrote:
David Newton wrote:I'm not sure what, exactly, you're trying to do.
FreeMarker's tag support requires the template mechanism to be run through the FreemarkerServlet (or equivalent, like an S2 "freemarker" result).
See how FreeMarker supports custom tags in the Using FreeMarker with Servlets portion of the FreeMarker manual.
hi, David. thanks a lot for your help and info.
and i've solved this pro now...
as it is, ftl can be rendered as view when we set "result type=freemarker" in s2 cfg, and the ftls support s2's tags.
but i jsut take use of freemarker to generate html files, and this is the right reason why the lousy exception occured. -- the result type! I returned no result and attempted to make it handled in the action method...
different from jsp, there must be an engine to render the code when using freemarker. but s2 has a special mechanism to process freemarker when setting "result type="freemarker". so i extract the source code of class "FreemarkerResult" and refact the method to write a local file rather than response to the client.
all i need to do is:
1. Create a java file ViewAndGenerateResult.java
2. copy the code from FreemarkerResult.java and modify it to generate file rather than response to the client.
3. register this result type.
well, so this is how i get it through... :)
thanks again. David.
btw, excuse my poor english.. :D
Aran Tam
Did you see how Paul cut 87% off of his electric heat bill with 82 watts of micro heaters? |