public class AdminServlet extends HttpServlet { private static final String CONTENT_TYPE = "text/html; charset=windows-1256"; AdminClass admin = new AdminClass(); SearchList list = new SearchList(); public void init(ServletConfig config) throws ServletException { super.init(config); }
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType(CONTENT_TYPE); PrintWriter out = response.getWriter(); out.println("<html>"); out.println("<head><title>AdminServlet</title></head>"); out.println("<body>"); out.println("<p>The servlet has received a GET. This is the reply.</p>"); out.println("</body></html>"); out.close(); }
if (commonModule.login(username, password)) { // Check the user if he is an admin or not // Load admin page user = commonModule.getUser(username); request.getSession().setAttribute("username",user.getUsername()); if (user.getUserType() == 1) { session.setAttribute("admin", user); request.setAttribute("adminTable", admin.getSearchLists()); RequestDispatcher view = request.getRequestDispatcher("admin.jsp"); request.getSession().setAttribute("fullname",user.getFullname()); view.forward(request,response); }
Comment s ConnectionString class This class is responsible for connecting to the database through a property file(config.properties) Connect() this method is used to make the connection string and connecting to the database closeConnection() this method is used to close the connection from the database
AdminClass This class is a data access object that access the database for adding , editing ,deleting the search list for the admin addNewSearchList : this method add new search to the databass edit Search : this method edit existing search list in the database delete search : this method delete existing search list from the database loadallSearchLists: this method get all existing search list from the database and return them in an arraylist of type SearchList.
CommonClass This class is responsible for adding ,editing , getting and checking users business and logic And managing user access Login() :this method is for logging in the user it checks for the username and password in the database then return true or false as user existence Register(): this method for registering the user
///////////////////////getListValue//////////////////// /** * @param listName * @return arraylist of lists * this method is to get the lists that match the list name parmeter */ /////////////////////////////////addSearchCategory////////////////////// /** * @param category * @return added_or_Not * this method to add new search ctegory to the seach category table * and return bolean variable that indicate if the recored added succesfuly or not * if added succesfuly return true * if not rturn false
*/ //////////////////////////////addValueOfSearchCategory/////////////////////////// /** * @param CategoryName * @param CategoryValue * @return added_or_Not * this method can ad value for the categoryname parameter */ ///////////////////////////////////deleteSearchCategory///////////////////////////// /** * @param categoryIndex * @return added_or_Not * this method delete list from search category table which its index as category index parameter */ //////////////////////////////editSearchCategory/////////////// /** * @param CategoryKey * @param UpdatedValue * @return saved_or_Not * this method can edit in the value of specific list and return true if saved and false otherwise */ //////////////////loadSoldBuilding///////////////// /** * @param sold * @return object of type building * load all bought buildings */ ////////////////////////loadBuyBuilding////////////////
View Answers
August 19, 2010 at 5:55 AM
Sorry i forget my Question is : the Foreach tag does not return any values from the database i used an arraylist to get the data ana iterate through it to get data
Related Pages:
JSP
JSP Hi,
What is JSP? What is the use of JSP?
Thanks
Hi,
JSP Stands for Java Server Pages. It is Java technology for developing web applications.
JSP is very easy to learn and it allows the developers to use Java
JSP JSP What is JSP?
JavaServer Pages (JSP) is a server-side Java technology an extension to the Java servlet technology that helps... document types.
Hi,
Here is the answer.
JavaServer Pages (JSP
jsp
jsp how to assign javascript varible to java method in jsp without using servlet
JSP
objects in jsp
Implicit objects in jsp are the objects... and are created at the conversion time of a jsp into a servlet. But we can pass....
For more information, visit the following link:
http://www.roseindia.net/help/java
JSP
objects in jsp
Implicit objects in jsp are the objects... and are created at the conversion time of a jsp into a servlet. But we can pass....
For more information, visit the following link:
http://www.roseindia.net/help/java/o
JSP
the following link:
http://www.roseindia.net/help/java/o/jsp-implicit-objects.shtml
 ..., visit the following link:
http://www.roseindia.net/help/java/o/jsp-implicit...JSP what are different implicit objects of jsp
mplicit
JSP
how can we use beans in jsp how can we use beans in jspJSP provides three tags to work with beans:-
<jsp:useBean id="bean name... = the name that refers to the bean.Bean class = name of the java class
JSP JSP My question is
How to create referral hyperlink to the target websites using JSP/JAVA/HTMl...?
for eg:assume gmail is the target website...take google as the base website...there are referral hyperlinks
JSP
JSP Create a JSP to check the status of bus ticket reservation from the database. Status will be marked with character. Reserved (r), waiting (w), cancelled (c).
Please visit the following link:
Java Airline Ticket
jsp and java jsp and java how to write a jsp and related java code to enter student marks into database
jsp
api.jar file inside the lib folder.
4)Now create a jsp file:'hello.jsp'
<%@page language="java"%>
<%String st="Hello World";
%>
Message is <%=st%>
5)Put this jsp file inside the apache-tomcat>>webapps>>web
JSP JSP how to open and view a flat file in browser using java code in jsp?
Hi Friend,
If you want to simply open a file then try the following code:
<%@page import="java.util.*"%>
<%
Runtime rt
JSP
JSP Hi ,
I am working in JSP. In my project i have to generate my entire database records to pdf,excel,csv format , so which concept i have to use... available on internet.
If you have to write Java program for this then you
jsp JSP Registration Form <%@ 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
jsp JSP User Registration form <%@ 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
jsp JSP User Registration Form <%@ 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
jsp JSP Form for registration <%@ 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
jsp
jsp i am using java inside java script page.
in that page i want to use two dropdown list.
in first dropdown list i am getting data from sql server database.
in second dropdown list i want to get data according to selection made
JSP
in listview or in gridview within JSP?
Hi Friend,
Try the following code:
pagination.jsp:
<%@ page language="java" %>
<%@ page import...;Pagination of JSP page</h3>
<body>
<form>
<input type="hidden
java/jsp java/jsp In a JSP program called books.jsp, the Java code
out.print(request.getParameter(â??numberâ??));
displays "1111111â??. What are the possible ways for the parameter number to have got its value
java jsp - JSP-Servlet java jsp i have a jsp file, in that i am uploading a file, after uploading the file had to display in the screen. it is displaying if only i refresh the page.
but i want to display the uploaded file without refreshing the page
jsp
jsp p>in my project i have following jsp in this jsp the pagesize=30 but i have to create drop down box with values 10,20,30. and i have to pass...="text/html; charset=UTF-8" language="java"
import="java.sql.<em>,java.util.
jsp
How to create a user registration form JSP <%@ 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
jsp
Form in JSP <%@ 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">
jsp
User form in JSP <%@ 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
java jsp java jsp please I want code to parse a web page using Dom parser,
thanks
java jsp java jsp it is : javax.servlet.jsp only but getting error wt is reason?
Use javax.servlet.jsp.* in your code
JSP with java/servlet - JSP-Servlet JSP with java/servlet Thanks Deepak for your answere to my previous question.
With reference to my previous question about JSP populate, actually I... (java bean or servlet) to fecth the database. Jsp would get the data from
JAVA JSP and Servlet - JSP-Servlet JAVAJSP and Servlet for sending mail through lan without intenet and also chatting facility for online users using JavaJSP & SERVLET code. Hi Friend,
Please visit the following links:
http://www.roseindia.net
multiuser in java/jsp? - JSP-Servlet
multiuser in java/jsp? Hi!!! Rose India Team,
Kindly let me know what is exact meaning of multiuser in java?
I made an web application using jsp... friend,
Multi User in Jsp : More then one User can access in Web appication
JAVA,JSP,SERVELTS JAVA,JSP,SERVELTS plz Send me Login Page by using core java ,Jsp,Servelts
java - JSP-Servlet
java why is required to write both jsp and servlet in a application of java
Java or Jsp code - JSP-Servlet Java or Jsp code Hello Sir,
How to create the code for the password recovery page(like forgot gmail password question and answer page)using the radion buttons in display the same page in jsp.I need only how to make
jsp - JSP-Servlet
jsp how to use java program in jsp ie, how to call a java program from jsp page
I saw some of the sample java programs like - webapps/examples...).... Hi friend,
For use Java program(or beans) in JSP visit to :
http
java+jsp - Java Beginners java+jsp I want to know how can I use java class in my jsp page?i'm...;
Password:
---------------------------------
java file...://www.roseindia.net/jsp/
Thanks
A Java Program by using JSP
A Java Program by using JSP how to draw lines by using JSP plz show me the solution by using program
jsp - Java Beginners
jsp hi i want to send selected checkbox values one jsp to another jsp
Java JSP - JDBC Java JSP JDBC connectivity in JSP? Hi Friend,
Please visit the following link:
http://www.roseindia.net/jsp/Accessingdatabase-fromJSP.shtml
Hope that it will be helpful for you.
Thanks
jsp - JSP-Servlet
jsp it is possible to fire a java page from a jsp page through tag Hi Friend,
Yes you can but it will show the java code.
The standard and useful way of using the java file is through the tag.
http
jsp - JSP-Servlet
://www.roseindia.net/jsp/usingbeansinjsp.shtml
http://www.roseindia.net/jsp/java...-bean-counter.shtml
http://www.roseindia.net/jsp/java-bean-example-jsp.shtml... is invalid.
This is JSP page
jsp - JSP-Servlet
jsp Hi
How to inactive button based on checking condition in jsp page(using java code)?
With Regards
Venkatesan