Hi Friends
I am devwloping a simple
JSP page which will convert INR to Dollar but I get following Error:
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: An exception occurred processing JSP page /TestConver.jsp at line 13
10: <body>
11: <%
12:
String str=request.getParameter("input");
13: int x=Integer.parseInt("str");
14: double d=(double)50/x;
15: %>
16:
Please find my both JSP and HTML page code as below:
HTML Page:
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Conversion Table</title>
</head>
<form name ="test" method="post" action="TestConver.jsp">
<body>
<select name="sel">
<option> INR to Dollar </option>
<option> Meter to KiloMeter </option>
<option> INR to Dollar </option>
</select>
<Input type="text" value=" " name="input"> Enter the Data:</Input>
<Input type="submit" value="Enter" name="submit" > Enter</Input>
</body>
</html>
JSP Page:
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ page import=" java.util.*" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Conversion here</title>
</head>
<body>
<%
String str=request.getParameter("input");
int x=Integer.parseInt("str");
double d=(double)50/x;
%>
<%=request.getParameter("sel")%>
<%=d %>
</body>
</html>
Guide me what to do