Need Help With Starting a jsp WebSite?

mr_______bond
mr_______bond used Ask the Experts™
on
Hi, I have a weird question? I know how to program servlets, jsp and how to connect with database, but I dont know where to start with a website.
I have already coded (HTML) for a website which deals with selling of AirLine Tickets and am planning to use session tracking instead of login also I have a search page and a shopping cart.

Can anyone post a link for a tutorial that tells me how to start? I mean where to put my session tracking servlet/jsp and about connecting pages.

I already have the tomcat and db setup.

Thanx a lot!
- Gaurav

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
This is an example of how session variables are used

in action page    e.g  newpage.jsp
u can have
<%
String sessionID =request.getParameter("sessionID ");

//    Here you have to retrieve ur value from database and
//    put     sessionID =value retrieved
like
sessionID =GetNewID(request);  // GetNewpage is a function to retrieve ur new page

session.setAttribute("sessionID ", sessionID );

response.sendRedirect("originalform.jsp");

in your orignal form
sessionID is either an hidden field

sessionID =(String) session.getAttribute("sessionID ");

if (sessionID ==null) {
   sessionID =(String)session.getValue("sessionID ");
 }
if (sessionID ==null) {
   sessionID ="";  
 }
session.putValue("sessionID ",sessionID );

on Submit()
action property"newpage.jsp" will get sessionID variable from db and will update ur include page on return

on each page you have to check for sessionID to control access to the page
Commented:
I don't think you can use session tracking instead of login but you can use session to track the user and track if they are logged in.

CJ
Amazon Web Services

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

if you are looking a public site that can host you jsp page for free, that is
www.mycgiserver.com

Commented:
You can track users around your site without them logging in (see Karaa).  Session tracking relies on cookies though.  If a user comes back later you will not be able to link them with their original session.

What I would look at doing is creating 1 shopping cart object that holds everything.  This shopping cart object is then stored in the session.  (You should avoid putting too many objects directly into the session as it can get messy very quickly.)  All of your users purcheses can now be stored in the shopping card object.

As for connecting pages you should look at the struts framework (http://jakarta.apache.org/struts/).  It is an excellent framework for web apps and will provide methods for connecting your pages and jsp's.

Finally check out servlet filters, you may not use them but they are a powerful tool to have available.
Distinguished Expert 2018

Commented:
No comment has been added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:

Split: ryancys {http:#9238937} & Karaa {http:#9241296} & cheekycj {http:#9243238} & kennethxu {http:#9245293}

Please leave any comments here within the next four days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

girionis
EE Cleanup Volunteer

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial