You are on page 1of 5

first install tomcat-4.1.18 software in your s/m c drive..

type this two files

a.jsp

<% String name=request.getParameter("name");%>

<% String icecream=request.getParameter("icecream");%>

<% String[] kind=request.getParameterValues("topping");%>

<% String place=request.getParameter("place");%>

<%int i;%>

<html>
<body>

Ms.<%=name%>

Welcome to our shop for purchasing <%=icecream%>

<% if(kind==null)%>

with no topping

<% else {%>

with topping

<%for(i=0;i<kind.length;i++){%>

<%=kind[i]%>

<%}%>

<%}%>

<% if(place.equals("here")){%>

enjoy eating here

<%}else %>

enjoy eating out

</body>

</html>

a.html

<html><head><title>JSP</title></head>

<body>

<p>name:</p>

<form action=http://localhost:8080/examples/jsp/a.jsp method=post>

<input type="text" name="name">


<select name="icecream" size="1">

<option value="vennila">vennila</option>

<option value="chocolate">chocolate</option>

<option value="strawberry">strawberry</option>

</select>

<p>topping:</p>

<input type="checkbox" name=topping value="nutts">nutts

<input type="checkbox" name=topping value="butter">butter

<p>place

<input type="radio" name=place value="here">here

<input type="radio" name=place value="out">out

<input type="submit" value="order">

<input type="reset" value="reset">

</body>

then do copy "a.jsp" file

then go to this “C:\tomcat-4.1.18\webapps\examples\jsp” path paste this “a.jsp” file..

then go this path C:\Jsdk2.0\bin run this servletrunner.exe file

then run the a.html file..give your options you will be get output..then start to do your IBM project..all
the best..

your o/p screen like

You might also like