aspose file tools*
The moose likes JSP and the fly likes Help needed in login page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Help needed in login page" Watch "Help needed in login page" New topic
Author

Help needed in login page

pinga kanave
Greenhorn

Joined: Mar 11, 2010
Posts: 20
Hi guys,
I have just started learning JSP and implemented login model in my application.

Request all of you to kindly go through the code and suggest any recommendation if required.

Though there is no error while executing the code and getting the login page . I just wanted to know whether the code is written in proper manner or not.


Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61648
    
  67

Not even close. Modern JSP should have no Java code embedded within it. Java should be handled in servlet controllers or other classes.

Also, database access should be handled in a model layer that is completely separate from any UI.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16250
    
  21

And finally, writing your own login/security system is a BAD IDEA. Most people write security systems that are no more secure than a cardboard box, based on the apps I've encountered over these many long years.

Use the J2EE built-in security framework. Leave the DIY login stuff for the code samples in books.


Customer surveys are for companies who didn't pay proper attention to begin with.
Jelle Klap
Bartender

Joined: Mar 10, 2008
Posts: 1823
    
    7

Plus, there's a HUGE glaring security leak that renders the authentication mechanism basically pointless.
It has to do with the way you build up the SQL statement. Google "SQL injection" for a bit, and you'll see what I mean.


Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.
Danilo Dadonas
Ranch Hand

Joined: Aug 24, 2007
Posts: 59

My advice is to begin from here: Head First Servlets and JSP


Dadonas<br /> <br />Don't gain the world and lose your soul.
Guilherme Mendonca
Greenhorn

Joined: May 28, 2010
Posts: 1
Like Dadonas said, i think you are not in the right way, if you try to read Head First : Servlets and Jsps, this will teach you programming with better patterns and its easier than it looks.
pinga kanave
Greenhorn

Joined: Mar 11, 2010
Posts: 20
Guilherme Mendonca wrote:Like Dadonas said, i think you are not in the right way, if you try to read Head First : Servlets and Jsps, this will teach you programming with better patterns and its easier than it looks.


You are right friend .I had done JSP a long time back. I would like to learn Latest approach for doing JSP programming. Request you to please give me a useful link/material to start with.

Also above link is forbidden in my office due to shopping category.

Expecting positive reply.

I would also like to know the difference between jsp and jspx pages.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61648
    
  67

Modern JSP should use the JSTL (JSP Standard tag Library) and the EL (Expressions Language) and avoid scriptlets and scriptlet expressions.

jspx files are XML-formatted JSP documents that are used as intermediate formats or for JSPs auto-generated by code. It is not a suitable format for hand coding.
pinga kanave
Greenhorn

Joined: Mar 11, 2010
Posts: 20
Bear Bibeault wrote:Modern JSP should use the JSTL (JSP Standard tag Library) and the EL (Expressions Language) and avoid scriptlets and scriptlet expressions.

jspx files are XML-formatted JSP documents that are used as intermediate formats or for JSPs auto-generated by code. It is not a suitable format for hand coding.


Being a novice to java I would like to begin JSP from scratch .I would like to know which technology should i prefer.
1) Developing web application using netbean.
2) Developing web applications using eclips.
3) Using any other technology.


Please suggest as i m so confused about my next step in building JSP.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61648
    
  67

Netbeans and eclipse are not technologies. They are just IDEs. It doesn't matter which one you use, or if you use an IDE at all. It has nothing to do with JSP.
 
wood burning stoves
 
subject: Help needed in login page