Registering a JSP in this manner allows you to specify the load order, initialization parameters, and security roles for a JSP, just as you would for a servlet.
Oook, I see you're the man to listen to I actually have "Prototype and Scriptaculous in Action" on my shelf
Anywho, I won't ask you for a code example, but some reading links would be appreciated. Hell, if its in one of your books just tell me which one, my MasterCard is right next to me!
But let me just take a guess from your comment: I forward all page calls to one jsp||servlet and in it I take what the user wanted from request.getRequestURI(), append the ".jsp" to it and use RequestDispatchers forward method?
But before I do any of it I'm gonna read this through.
[ December 18, 2008: Message edited by: Predrag Stojadinovic ] [ December 18, 2008: Message edited by: Predrag Stojadinovic ]
Originally posted by Predrag Stojadinovic: But before I do any of it I'm gonna read this through.
That article is exactly what I was about to recommend.
It should give you a good feel for the modern state of web application structure best practices, where page controllers handle the setup for JSP pages, and the JSPs themselves are simple ("dumb") view components that use JSTL and EL in favor of old-fashioned scriptlets.
Predrag Stojadinovic
Greenhorn
Joined: Nov 18, 2008
Posts: 15
posted
0
I read, I tried, I failed miserably...
Help [ December 18, 2008: Message edited by: Predrag Stojadinovic ]
Jimmy Clark
Ranch Hand
Joined: Apr 16, 2008
Posts: 2187
posted
0
Go download the Struts libraries and read a tutorial or two. This should get you started on learning the Model-View-Controller design pattern. Once you learn this, you could then branch out and possibly start coding your own stuff.
Or check out my Front Man front controller implementation. Struts is a beast.
Predrag Stojadinovic
Greenhorn
Joined: Nov 18, 2008
Posts: 15
posted
0
Originally posted by Bear Bibeault: Or check out my Front Man front controller implementation. Struts is a beast.
- I already saw the Front Man and wrote down to check it out asap
Originally posted by James Clark: ...you could then branch out and possibly start coding your own stuff.
- Yo James, I'm not quite sure what you mean by "start coding your own stuff"? I'm no Bear B. but c'mon, "start"?
Jimmy Clark
Ranch Hand
Joined: Apr 16, 2008
Posts: 2187
posted
0
Based upon the code that you posted, it certainly looks like you are attempting (aka starting) to write a Controller. This would be a good programming exercise, if you have the time and are interested in the details of how you would design a Controller. However, FrontMan is already written and the Struts Controller is already written. Take your pick ) [ December 18, 2008: Message edited by: James Clark ]
Venki Ananth
Ranch Hand
Joined: Dec 17, 2008
Posts: 32
posted
0
Hi,
Create a new servlet "wecome and then do redirect to "welcome.jsp"
Else "welcome.jsp" will have its own servlet so do mapping in "web.xml" like this, <servlet> <servlet-name>wecome</servlet-name> <jsp-file>welcome.jsp</jsp-file> </servlet> <servlet-mapping> <servlet-name>welcome</servlet-name> <url-pattern>welcome</url-pattern> </servlet-mapping> [ December 18, 2008: Message edited by: Venki R ]
Venki
http://saalram.com
Predrag Stojadinovic
Greenhorn
Joined: Nov 18, 2008
Posts: 15
posted
0
Originally posted by James Clark: Based upon the code that you posted, it certainly looks like you are attempting (aka starting) to write a Controller.
True that...
Well, it's better to use the wheel than to re-invent it, right? And since the FrontMan is seriously lighter than Struts... easy pick...
On the other hand, a friend of mine just suggested a filter instead of the Controller?
Like:
I will try this tonight when I get home from work. And if this fails I will use the FrontMan. [ December 19, 2008: Message edited by: Predrag Stojadinovic ]
I don't like using filters as a controller, rather I use them as filters, and use controllers as controllers. Sorta like using an ice pick to clean your teeth. It can work, but...
Jimmy Clark
Ranch Hand
Joined: Apr 16, 2008
Posts: 2187
posted
0
lol
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.
subject: How to display a page without the trailing .jsp