I am using Struts 1.2.9 with the bundled Tiles. I know its a lot older, and I should probably upgrade, but I would need to do a lot of refactoring to make my application work with Struts2 and the now separated Tiles2.
Also, I'm aware that Struts and Tiles can not give me a PDF, that is why I'm using iText for that function. As to why I am mixing HTML and PDF, I want my resulting PDF to match the Struts/Tiles/JSP generated report so I figured the best way to do that was to capture the resulting HTML (which is the input that iText apparently needs to create a PDF). In order to get that I am using the HttpURLConnection to grab the content of that call and then parse that stream into iText. ----- Original Message ---- From: Antonio Petrelli <[EMAIL PROTECTED]> To: [email protected] Sent: Wednesday, July 9, 2008 9:49:58 AM Subject: Re: Struts-Tiles - Missing Content 2008/7/9 Ryan Henson <[EMAIL PROTECTED]>: > I think I have found a strange behaviour in the Struts-Tiles framework that I > am attempting to pin down and understand. First of all, what version of Struts and Tiles are you using? > I've been experimenting with multiple variations on how to accomplish > this so my below code is a little messy, but it does create and return > a PDF, but it is missing the content it should have. As far as I can > tell from the order of events the following occurs. I open my browser > to the makePDF.do action which sets up an HttpURLConnection to the > getReport action. The getReport action then forwards to the tiles name > which retrieves the layout jsp and is where it should insert the tiles > attributes and get the report content. This is where it breaks down > however and the only HTML that is returned is from the layout page. You're mixing PDF and HTML. Do you want to return a PDF to the user? So use directly the HttpServletResponse. > My goal is to simply convert the resulting HTML code into a PDF > document, so if there is another approach I could take I am open to it. Neither Struts nor Tiles can help in this. Antonio
