I am trying to make a web page that when a submit button is clicked my database is updated with the user information. I have the files done and configured Tomcat. The problem is when I clicks the submit button I get a loaded page with
<% String driver, url, username, password, execution, sql;
driver = request.getParameter("driver");
url = request.getParameter("url");
username = request.getParameter("username");
password = request.getParameter("password");
execution = request.getParameter("execution");
sql = request.getParameter("sql");
%>
which is part of my .jsp file.
Any ideas?
JSP related question
Started by thieflock, May 05 2009 11:36 AM
2 replies to this topic
#1
Posted 05 May 2009 - 11:36 AM
|
|
|
#2
Posted 05 May 2009 - 11:37 AM
What is surrounding that in the source jsp file?
#3
Posted 05 May 2009 - 11:38 AM
Sorry I submitted the wrong code, this is what is printing
<%
String ISBN, bookTitle, authorLName, authorFName, bookPublisher, bookSynopsis. yearOfPub, bookQuantity;
ISBN = request.getParameter("ISBN");
bookTitle = request.getParameter("bookTitle");
authorLName = request.getParameter("authorLName");
authorFName = request.getParameter("authorFName");
bookPublisher = request.getParameter("bookPublisher");
bookSynopsis = request.getParameter("bookSynopsis");
yearOfPub = request.getParameter("yearOfPub");
bookQuantity = request.getParameter("bookQuantity");
%>
and this is the whole file:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<link rel="stylesheet" href="template.css" type="text/css">
<meta content="text/html; charset=ISO-8859-1"
http-equiv="content-type">
</head>
<body>
<%
String ISBN, bookTitle, authorLName, authorFName, bookPublisher, bookSynopsis. yearOfPub, bookQuantity;
ISBN = request.getParameter("ISBN");
bookTitle = request.getParameter("bookTitle");
authorLName = request.getParameter("authorLName");
authorFName = request.getParameter("authorFName");
bookPublisher = request.getParameter("bookPublisher");
bookSynopsis = request.getParameter("bookSynopsis");
yearOfPub = request.getParameter("yearOfPub");
bookQuantity = request.getParameter("bookQuantity");
%>
<jsp:useBean id="addBookBean" class="myBeans.AddBookBean">
<jsp:setProperty name="addBookBean" property="ISBN" value="<%= ISBN %>" />
<jsp:setProperty name="addBookBean" property="bookTitle" value="<%= bookTitle %>" />
<jsp:setProperty name="addBookBean" property="authorLName" value="<%= authorFName %>" />
<jsp:setProperty name="addBookBean" property="bookPublisher" value="<%= bookPublisher %>" />
<jsp:setProperty name="addBookBean" property="bookSynopsis" value="<%= bookSynopsis %>" />
<jsp:setProperty name="addBookBean" property="yearOfPub" value="<%= yearOfPub %>" />
<jsp:setProperty name="addBookBean" property="bookQuantity" value="<%= bookQuantity %>" />
</body>
</html>


Sign In
Create Account


Back to top









