Solved

JSP's and information in URL's

Posted on 2004-04-30
3
178 Views
Last Modified: 2010-04-01
Hi all

The trouble I am having is this...

I have a number of pages that all use the same header, footer and navigation bar, the only difference between them is that they have a different form (html page), one is user registration, 1 is login etc...

I want to create a page where i can send it a name in the url

e.g.
template.jsp?content=logIn

then i need to get the name of the parameter(content) and use it to include the html form...

Can anyone please tell mehow to do this

Many thanks in advance
0
Comment
Question by:KrisM82
3 Comments
 
LVL 4

Accepted Solution

by:
indigostark earned 45 total points
ID: 10959655
in your main template.jsp
have something like the following

<%
       String content = request.getParameter("content");
       
       if(content.equalsIgnoreCase("login"))
       {
%>

<%@ include file="loginForm.htm" %>

<%
      }
       else if(content.equalsIgnoreCase("registration"))
      {
%>

<%@ include file="registrationForm.htm" %>

<%
       }
%>

etc........................
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

How do we balance the user experience (UX) with reasonable security measures? It can be done, if you keep these fundamentals in mind.
Knowing where your website is hosted is as important as the features you receive, the monthly fee, and the support you receive. Due diligence should be done when choosing your next hosting provider.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

776 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