Yes, but Brad was suggesting one servlet to rule them all. If I specify that it needs SSL, then I get encryption for everything, I think.

Todd

On Dec 31, 2003, at 5:51 AM, Geir Magnusson Jr wrote:


On Dec 30, 2003, at 10:52 PM, Todd O'Bryan wrote:


But I really only want the sensitive stuff to use SSL, don't I? I suppose I could split the app into two servlets, one for secure stuff, the other for non-sensitive info.

SSL is outside of the servlet. The infrastructure handles it for you.


geir


Todd


On Dec 30, 2003, at 5:08 PM, Brad Cox wrote:

Sure. Set 'em for one and you've set them for all. See http://virtualschool.edu/jwaa for the support code, which isn't hard, just a HashMap of strings to dispatch to basically, and a page class for each target. A lot less scary that configuring a servlet per page, IMO. Never saw the point to that.

At 4:46 PM -0500 12/30/03, Todd O'Bryan wrote:
Ahhh, that's an idea. And maybe we'll move to that, but when I start with my students I don't want it to be too scary.

Also, can you set requirements for SSL and such that way?

Todd

On Dec 30, 2003, at 4:13 PM, Brad Cox wrote:

Why not use one servlet that dispatches requests to multiple handlers based on pathInfo()?

At 3:30 PM -0500 12/30/03, Todd O'Bryan wrote:
Maybe I'm approaching this the wrong way and something else would be easier...

I have a bunch of cases that need to access a database, do some logic, and then output a web page.
I figure each case corresponds nicely to a subclass of VelocityViewServlet overriding the handleRequest()
method. So, I register each of my ten or twelve servlets in the web.xml file with a url-pattern, and I'm good
to go.


But, don't I have to add an <init-param> tag for every single subclass I've done, even though they all use the same properties? I tried adding a <context-param> of the same name and value to the server.xml file, but that didn't work ('course I was pretty sure it wouldn't since I don't really know what <context-param> is for).

I guess my question is, is there a default place that VelocityViewServlet would look for (a) its velocimacros library, or (b) its properties file so that I can have it do the right thing without so much futzing about? Failing that, is there some way to set the properties location for all subclasses of VelocityViewServlet once in a webapp, instead of doing each one individually?

Aside from laziness, the latter is a big mess if you ever decide to move your properties file, or have to change its name or anything else.

Is it really the case that there is no elegant way to do this, or is my problem that I shouldn't be subclassing VelocityViewServlet and there's some easy way to have this all just happen.

Todd

On Dec 30, 2003, at 1:33 PM, Nathan Bubna wrote:

Todd O'Bryan said:
OK. That answered the first question. Now for the second one: can I set
this once for all my subclasses of VelocityViewServlet, or do I have to
point each of them individually to the velocity.properties file?


Trying to avoid the latter,

well, at the present the VelocityViewServlet uses Velocity as a singleton.
this means that it should only need to be configured once per webapp. (that's
assuming the velocity jar is in the webapp and not the servlet engines shared
lib/classloader.) so i think you can avoid the latter, but i haven't tried
this.


however, in VelocityTools 1.2 we plan to convert the VVS to no longer use
Velocity in singleton mode. so, you should know that this is not really
recommended practice, and at some point in the future it will definitely not
work.


On Dec 30, 2003, at 1:06 PM, Tim Colson wrote:
And, please, if the answer is I have to set it in
velocity.properties, where do I put the velocity.properties file so
that it gets found, and is there a way to set its location once for
the entire context rather than for each individual servlet?

Brad -
Have a look at the Velocity Tools docs and the examples too. There is
a sample web.xml config which points to velocity.properties stored in
WEB-INF, and inside that puppy there is a setting to point to global
macro file(s).


http://jakarta.apache.org/velocity/tools/view/

velocimacro.library = /WEB-INF/VM_global_library.vm

Cheers,
Timo

Nathan Bubna [EMAIL PROTECTED]


----------------------------------------------------------------- ----
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




------------------------------------------------------------------ ---
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


--
Brad J. Cox, PhD, 703 361 4751, http://virtualschool.edu
http://virtualschool.edu/mybank Digital Rights Management System
http://virtualschool.edu/jco Java Cryptographic Objects (JCO)
http://virtualschool.edu/jwaa Java Web Application Architecture (JWAA)
http://virtualschool.edu/java+ Java Preprocessor (Java+)


------------------------------------------------------------------- --
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-------------------------------------------------------------------- -
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


--
Brad J. Cox, PhD, 703 361 4751, http://virtualschool.edu
http://virtualschool.edu/mybank Digital Rights Management System
http://virtualschool.edu/jco Java Cryptographic Objects (JCO)
http://virtualschool.edu/jwaa Java Web Application Architecture (JWAA)
http://virtualschool.edu/java+ Java Preprocessor (Java+)


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


--
Geir Magnusson Jr                                   203-247-1713(m)
[EMAIL PROTECTED]


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to