• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Change text in servlet response with filter ?

 
Juergen Unfried
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9528
33
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Its easy to find such a thing on google. Example...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic