Re: making all pages to fo index.jsp

2014-07-31 Thread André Warnier

Aryeh Friedman wrote:

I want to make it so every page that does not have a actual .jsp file gets
sent back index.jsp.  I am doing it with error-page but that also sends a
404 I want zero clue they landed on a non-existent page


There are certainly ways to achieve what you describe above.
But I think that you should really question the basic logic of doing so.
The 404 response is there for a reason : to stop clients from repeating requests for 
something that does not exist.  If you hide that condition to the client, and return what 
appears to be a real content, then how can a client ever determine that what he requests 
does not exist, and react intelligently ?  What is there to stop this client looping 
forever, and swamping your server with useless requests ?


Imagine that the file system of your server would do the same : if some program tries to 
open a file which does not exist, the OS does not return an error, but opens some other 
file instead.  Doesn't make sense, does it ?



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



making all pages to fo index.jsp

2014-07-30 Thread Aryeh Friedman
I want to make it so every page that does not have a actual .jsp file gets
sent back index.jsp.  I am doing it with error-page but that also sends a
404 I want zero clue they landed on a non-existent page

-- 
Aryeh M. Friedman, Lead Developer, http://www.PetiteCloud.org


Re: making all pages to fo index.jsp

2014-07-30 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Aryeh,

On 7/30/14, 4:12 PM, Aryeh Friedman wrote:
 I want to make it so every page that does not have a actual .jsp
 file gets sent back index.jsp.  I am doing it with error-page but
 that also sends a 404 I want zero clue they landed on a
 non-existent page

So, any URL that /does not/ end with .jsp needs to be sent to index.jsp?

This sounds like you're doing it wrong.

If you absolutely have to do it wrong, you could do this:

1. Write a Filter that sets a request attribute like request-okay
2. Map the Filter from #1 to *.jsp
3. Write another Filter that checks for the request-okay attribute
and forwards to /index.jsp if it's not there.
4. Map the Filter from #3 to /*

Make sure that Filter #1 runs before #3.

I'm not sure why you'd bother with all this, though.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJT2aTRAAoJEBzwKT+lPKRYGnUP/i63RJXs5kMNqTZo2reBJ7Gt
ShBTudJK6hAe7Hv7p+AUB4u4QImTsZT4zvVLUFIQ085K8eQ6REaXPw13+xvgdD8Z
xlITa51UbvSkkGtzGH6Um/5BNjQEs4MFIzztez53yE5jRuRQ7L/v8AYwELbO6oqK
ElNxBk+3cT7uFjLOInl33XqFDDuq5X2UR7X5hwiI5NfDBEvn4L6NCmBZ8yyCh/9Z
GrEWAlzqYH+Dg4cvNowwsbjxqWVPnDgqd/+ZVisK9PGkxkopEIZ3vHLZlM56rFt0
9VebJ4xccWRC1s/2zNFjfQPQ3v2Krbv9WWNmgp/nO2NVJvSDrd3u6vFyBXZZ6e5A
+0/hmIxRGVxaa5NV613ZdY2qOusUAfSXKbwDxj+f2/GkvnQVKwXR6KhP6m21HdJi
QZX0wn8BtijUotUjThXWmlSgQrGFTp9TdggoGb46xalS2pAC3Uc2vcAlMR5myIkc
gUiy+o8oRYyi+H3yB59z6Z23ZH1nBRQ5Scz1+cjDCI2ybZsnwIZoU1BakqgYo7aa
2CCszm/magTGiLhhe9WkBKVY1dg/hJDt08QQSoFDX0fxW7GAHr8/1SZDbvw1SHyE
RAFnDsMB/AIvCrjIIOvHZD90OTG4vE8RF6YGWpgIbxuriOK9NMw1ggG5CzuwRQG5
tQQ37b1QMGNv/kLIULqJ
=6jFH
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org