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
Solved

JSP's and information in URL's

Posted on 2004-04-30
3
179 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
spring AOP 6 88
getting param value 7 58
maven webservice example issue 2 144
difference between projection and projection list in hibernate 1 122
Is your phone running out of space to hold pictures?  This article will show you quick tips on how to solve this problem.
IT certifications are a concrete representation of continual learning on the part of the candidate.  Continual learning is necessary for the long term success of an IT professional, but are IT certifications the right path for you?
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa‚Ķ

860 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