This week's book giveaway is in the Java in General forum.
We're giving away four copies of Think Java: How to Think Like a Computer Scientist and have Allen B. Downey & Chris Mayfield on-line!
See this thread for details.
Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • 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: 9519
22
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