aspose file tools*
The moose likes Struts and the fly likes Change text in servlet response with filter ? 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 » Frameworks » Struts
Bookmark "Change text in servlet response with filter ?" Watch "Change text in servlet response with filter ?" New topic
Author

Change text in servlet response with filter ?

Juergen Unfried
Greenhorn

Joined: Oct 11, 2006
Posts: 5
Hello,

I have a Struts 1.x application which serves a webpage for desktop users. Now I have to do an optimized version for smartphones which is working pretty nice. For this mobile version I have to filter out all images and make telephone numbers dialable in the mobile browser.

My plan was to use a filter which works on everything with /mobile/ in the url and basically do a .replaceAll(...). The filter is called but now I am stuck because I have no clue how to change the content of the response. All I find on the net is change content types. I also tried the getWriter() method to get the printwriter but I have no clue on how to change the text content of the repsonse.

any ideas what I am overseeing?

cheers,

Juergen
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9280
    
  17

Its easy to find such a thing on google. Example...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Change text in servlet response with filter ?
 
Similar Threads
"After" filter?
HFJS: Filters + Wrappers Explaination pg 721
How to send text message to my mobile?
HTTP Response
Capturing JSP Content Within My Strut Action Servlet