Solved

Regarding JSP controller

Posted on 2011-09-16
6
342 Views
Last Modified: 2013-11-11
Hi Friends,

what are the draw backs if i use JSP as a controller for handling the requests and responses(i.e Model 1) and using java code,scriptlets,declarations and expressions in jsp?
0
Comment
Question by:PrakashVarma
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 27

Accepted Solution

by:
mrcoffee365 earned 333 total points
ID: 36551598
Architecturally, some people like the request controller model.  In my experience, it means that users can't bookmark your pages.  It's also harder to send urls in emails for the controller situation (more parameters to help pass the user to the right place).  So for normal web apps, I prefer separate urls over the single controller model.

From a performance standpoint, there's no difference between the JSP model and the controller to bean model.  Tomcat and most other servlet engines have seriously optmized the server compilation from JSP to servlet, so you get servlet performance in both cases.

The general model of JSP for display and beans and other classes for the app is still a good one however.  It might improve performance but it will definitely improve your ability to enhance and maintain your web app.



0
 
LVL 27

Assisted Solution

by:rrz
rrz earned 167 total points
ID: 36552790
>what are the draw backs
http://www.java-samples.com/showtutorial.php?tutorialid=1010   

>using java code,scriptlets,declarations and expressions in jsp?  
These can easily kept to a minimum through the use of "Tag files"  and custom EL functions.
http://today.java.net/pub/a/today/2003/11/14/tagfiles.html 
http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JSPTags5.html 
see bottom of the page at  
http://download.oracle.com/javaee/5/tutorial/doc/bnahq.html
0
 
LVL 20

Expert Comment

by:Sathish David Kumar N
ID: 36553202
The main draw back is people can see your source code . right click on browser and see the view sources then they can find the values and all logic of controller program of your page .
0
How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

 

Author Comment

by:PrakashVarma
ID: 36553220
Hi Friends,
thanks for giving reply..,

rrz@871311,i saw your links but in first link i not understanding one point please clarify that(Bold one) i.e
It becomes very hard to change the structure of such Web applications because the pages are tightly coupled. They have to be aware of each other. What if you decide that, after updating the quantities in a shopping cart, you want to redirect the user back to the catalog? This could require moving code from the shopping cart page to the catalog page.
0
 
LVL 27

Assisted Solution

by:mrcoffee365
mrcoffee365 earned 333 total points
ID: 36553298
dravidnsr: I think you must be thinking of Javascript.  JSP code does not get sent to the browser and the user cannot see it.

PrakashVarma: JSP pages do not have to be badly written any more than any other code.  The quote you have about development problems are based on bad writing, not using JSP.  The writer of that page does not make it sufficiently clear what the difference is.
0
 
LVL 27

Expert Comment

by:rrz
ID: 36554476
I agree with mrcoffee. It comes down to writing style. As he suggested in his first post, the use of javabeans is recommended.
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I had a project requirement for a displaying a user workbench .This workbench would consist multiple data grids .In each grid the user will be able to see a large number of data. These data grids should allow the user to 1. Sort 2. Export the …
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question