Hello, so I'm a student and in one of my projects I have to capture the image of a client from a WebCamp and then save it on the database. Now, I'm having some problems and doubts. I've found some videos where they use the library JMF (Java Media Framework), but with J2SE. My project and all my classes are in Servlets/JSP with Struts2. So, I'm not sure how to adjust it. For example: What I did in my jsp, was this: <h1>Elegir la c├ímara Web disponible</h1> <s:select list="camaras" name="camaras" headerKey="-1" headerValue="Select Value"></s:select> Then, in my Action: @ParentPackage(value="Vet_V1") public class …

Member Avatar
Member Avatar
+1 forum 2

Hello Everyone, Already my web project is developed by using jsp and servlets now I would like to do security check on each and every pages. so, is there any software to check whether my all pages are robust and secure before deploying on to the live server. Eg: Like form validation on each page Sql injection etc. kindly help on this. Thanks in Advance.

Member Avatar
+0 forum 0

in my program a simple shopping application for my lab exercise, i just calculated the price of items inside a for loop but when i try to print it outside it is not getting printed...pls give me some suggestion. for (int i = 1; i < 7; i++) { String selection = request.getParameter("a" + i); if (selection.equals("l")) { price = Integer.parseInt(request.getParameter("b" + i)); total = total + price; out.println("<h3>You have purchased the item:<br>Price is:</h3>" + price); } } out.println("THE TOTAL IS"+total); out.println("</body>"); out.println("</html>");

Member Avatar
Member Avatar
+0 forum 9

I want to know how can i use a servlet to generate a table (time table for example) dynamically in a jsp page? The result should come between header and footer inside a div (see the picture) http://img191.imageshack.us/img191/8942/nbo6.png <html> <head> <title>Time Tables</title> <link href="default.css" rel="stylesheet" type="text/css"/> </head> <body> <div id="header"> <ul> <li> <a href="#home"> <div id="logo"> </div> </a> </li> <li> <div id="user"> <h4>Welcome, <font color="red">admin</font></h4> <ul id="menu"> <li><a href="#notification"> Notifications </a> <ul id="submenu"> <li> <a href="#">Inbox</a> </li> </ul> </li>| <li><a href="#profile"> My Profile </a> </li>| <li><a href="#settings"> Settings </a> </li>| <li><a href="logon.jsp"> Log out </a> </li> </ul> </div> </li> </ul> …

Member Avatar
+0 forum 0

Hi, I have learned that servlet containers like tomcat handle concurrency in web application. I just want to get a clear comfirmation whether I dont have to multithread my business logic classes/methods(e.g database connections) when I am developing servlet applications. Cheers!

Member Avatar
Member Avatar
+0 forum 1

I'm developing an application in JAVA where a servlet is taking the inputs from a JSP page. After inserting the values in db it will redirect to another servlet. Then the 2nd servlet will dispatch a JSP page with an ArrayList. But I can't redirect from the 2nd servlet to the JSP page. The ArrayList is going to the JSP page but the page is not showing anything. I'm using NetBeans 6.8. Code for 1st Servlet: RequestDispatcher dispatcher = request.getRequestDispatcher("/Servlet1?id="+id); dispatcher.forward(request, response); Code for 2nd Servlet: request.setAttribute("list",list); String url="test2.jsp"; RequestDispatcher v=request.getRequestDispatcher(""+url+""); v.forward(request, response); I've put a System.out.println("list values::"+list.get(0)); in the …

Member Avatar
Member Avatar
+0 forum 2

Is it necessary to learn Servlet programming when one is already comfortable with JSP

Member Avatar
Member Avatar
+0 forum 2

how can i make a servlet to validate a form with two file upload one image and other a pdf file. along with the other string parameters like name age gender etc., i need to validate the pdf and image files in servlet and save it in folder of my project, and the path and other parameters in database. please help..!! i need to do in servlets only first then will try in struts.

Member Avatar
Member Avatar
+0 forum 3

I have written a web app with a few JSP pages and Java servlets running on a Tomcat server. The app needs to be able to send location updates to a Servlet every x seconds. I have found the html5 watchPosition(sucess_callback, error_callback) function to get the location updates from the web page. I'm thinking.. once I get the update from this function.. I'll put code in the success_callback function to send the update to a Servlet. But adding the watchPosition function to every JSP page in the app seems cumbersome. What is the right way to send periodic GPS updates …

Member Avatar
+0 forum 0

I'm currently adding a dashboard-like view to my web project, which polls data from OIDs using SNMP. My current step is to use AJAX to reload the page but I'm running into some design issues on that front. Accessing the servlet class on the server will generate hello.jsp, which displays the current values of the OIDs. Once the user clicks the button it will update the div part of the page. However, I cant figure out how to make sure the div is updated with JUST the new div values. In its current form, the div is filled with the …

Member Avatar
+0 forum 0

I want to display image from database to my htnl form but it id not displayed. Image copied from database to local c:\file_upload folder but from this folder i want to display in img src in html form .project doesn't give any error but image not displayed on html form. Please help me. thank u !

Member Avatar
Member Avatar
+0 forum 3

System Information: OS: Ubuntu 11.10 Server: Tomcat 7.0 JVM: openjdk 1.6 I have checked if the server is running by going to [url]http://localhost:8080[/url]. It's working fine. I just need to know the directory in which I should save my servlet in order to run it. I think I am supposed to save it in the "Examples" folder but I don't know where it is located.

Member Avatar
Member Avatar
+0 forum 1

I am getting java.lang.nullpointer exception for this code plzz help me out all database linked programs are creating same error [code]import javax.servlet.*; import javax.servlet.http.*; import java.io.*; import java.sql.*; public class retser extends HttpServlet { Connection c; Statement st; ResultSet rs; ServletConfig config; public void init() { config = getServletConfig(); try { Class.forName("oracle.jdbc.driver.OracleDriver"); c = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:XE", "system", "tiger"); Statement st = c.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE); rs = st.executeQuery("select * from book"); } catch (Exception e) { } }//end init public void service(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { PrintWriter pw = res.getWriter(); try { int x = Integer.parseInt(req.getParameter("t1")); pw.println(x); rs.next(); pw.println(rs.getInt(1)); //+" …

Member Avatar
Member Avatar
+0 forum 1

hi, am working on a bigger project than this, only using this as an example because i do not want to waste a lot of your time. i have this code, its supposed to write to the database, but have no idea as to what i should put under action= "" in the html code. note: am using netbeans. i am able to read whats in a table but not writing to it using the web page created. [CODE] package paus; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.*; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.sql.*; @WebServlet(name = "EnteredDetails", …

Member Avatar
+0 forum 0

I have this servlet code for retrieving contents from database and displaying it on the browser.But when I am running this code it is giving "ClassNotFound Exception" at Class.forname().I have built the path with db2jcc.jar and db2jcc_license.jar file but still this exception is thrown.Please help me [CODE] import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.sql.Connection; import java.sql.Statement; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.*; /** * Servlet implementation class HelloServlet */ public class HelloServlet extends HttpServlet { public Statement statement; public Connection connection; private static final long serialVersionUID = 1L; /** * @see HttpServlet#HttpServlet() */ …

Member Avatar
+0 forum 0

Hi guys! am new to this forum and this is my first thread :) am not sure if am posting at the correct forum, but its regarding servlets am doing a web application for 'online exam' using jsp, servlets and java bean. i've three serialized files holding my questions(questions.ser), options(options.ser) and answers(answers.ser) in /WEB-INF. i read them and store in an arraylist in servlet. but all i get is java.io.filenotfoundexception.. i tried placing the .ser files in /WEB-INF/classes where servlet classes are placed.. still same error [CODE] ObjectInputStream questions = new ObjectInputStream(new FileInputStream("/WEB-INF/questions.ser")); ObjectInputStream options = new ObjectInputStream(new FileInputStream("/WEB-INF/options.ser")); ObjectInputStream …

Member Avatar
+0 forum 0

Hi guys, I need your help. I was trying to update a certain data in my database using jsp and servlet. However i can't figure out why it wouldn't update the data. :( I'd greatly appreciate it if you could check my codes below. THANKS MUCH! Here's my jsp [CODE] <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title></title> </head> <body> <c:import url="../menu.jsp"/> <br> <jsp:useBean id="foo" class="com.dole.cdms.application.Application" scope="request"/> <form action="ApplicationServlet" method="POST"> <table class="form"> <tr><td>Application ID:</td><td> <input type="text" name="appId" value="<jsp:getProperty name="foo" property="appId"/>"></td></tr> <tr><td>Application Name:</td><td> <input type="text" name="appName" value="<jsp:getProperty name="foo" property="appName"/>"></td></tr> <tr><td>Application Status:</td><td> <input name="appStatus" type="radio" value="1" checked="checked"> Active <input name="appStatus" type="radio" value="0">Inactive</td></tr> <tr><td></td><td><input …

Member Avatar
Member Avatar
+0 forum 1

I have a JSP page that has two pieces of data that I need to send to a page on another domain via post when a button is clicked. My original iteration was just having the two pieces of data in 2 hidden fields and when the user clicked a button it posted those two data and all was good in the universe. * I showed it to the client and they say that I can't have the data seen in View Source and I can't pass this data via get (even though anyone with a sniffer can grab the …

Member Avatar
+0 forum 0

How to do a HTTP PUT/DELETE? (Using jquery) . Im making a REST-ful twitter-type aplication using Java Servlets etc... and i have the methods for handling PUT and DELETE, i just need to be able to perform these e.g. when a user submits a form (with the id of the tweet to be deleted, for example). However, forms only support the methods POST and GET hence i was instructed to use jquery, which i am unfamiliar with. Can anyone help me?

Member Avatar
Member Avatar
+0 forum 1

this is inside my servlet: [CODE]ArrayList<String> currentCustomer = model.getAllCustomers(); req.setAttribute("currentCustomer", currentCustomer );[/CODE] how do i access this arraylist in my JSP file? I eventually wanna loop over each string element.

Member Avatar
Member Avatar
+0 forum 1

Hi, Does anyone know where I can read about ways to protect a website from potential threats? i.e. SQL Injection, etc. In particular, a website using HTML/JSP/Servlets/Java/Tomcat. Thanks, Ashton.

Member Avatar
Member Avatar
+0 forum 9

Hi, can anyone help me to split the servlet(week02_4) so that only control code remains.I need to forward/redirect request/responses to two other servlets(VowelFrequencyServlet and WordCountServlet).I am not sure where to place the RequestDispatcher. Week02_04 servlet: [CODE=java]package servlets; import java.io.*; import javax.servlet.*; import javax.servlet.http.*; public class Week02_04 extends HttpServlet { protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String reportType = request.getParameter("reportType"); response.setContentType("text/html;charset=UTF-8"); PrintWriter out = response.getWriter(); String userString = request.getParameter("userString"); try { out.println("<html>"); out.println("<head>"); out.println("<title>Servlet Week02_04</title>"); out.println("<link rel=\"stylesheet\" type=\"text/css\" href=\"Week02_04.css\">"); out.println("</head>"); out.println("<body>"); out.println("<h1>Servlet Week 02, Exercise 04</h1>"); out.println("<p class=\"inline\">You typed: '<pre class=\"inline\">" + userString + "</pre>'</p>"); if (reportType.equalsIgnoreCase("W")) …

Member Avatar
+0 forum 0

HI I am trying to pass a value from dropdown list on onchange event fo the dropdown in a jsp page through AJAX to servlet. The servlet then returns the value back to the jsp page and displays it in dropdown list. the problem I am facing is that the value returned is null. though in the servlet the value is set but when I pass the value to jsp, the value is null. somewhere I am passing the value properly. could someone please help. It's important. thnaks in advance. here is the code for that: inputPage.jsp <html> <head> </head> …

Member Avatar
Member Avatar
+0 forum 6

hi friends, I am a novice java programmer. I am in a learning process in java servlets. But i struck into a Class method which should return a result set([B]result of a join query[/B])as a an arrayList using the existing bean class. I will show my code as some one can point out what i should do or suggest me a (standard) method to access it. I am having a separate bean class for table users and table books. A book table which has list of books info, A user table which has list of users info, when a user …

Member Avatar
Member Avatar
+0 forum 2

Hi All, I have JSP and Servlet that need to "talk" to each other. Actually I need to get record from database, fill it in JSP file. I have created Servlet that does the query and gets the result. I need those results to be shown on JSP file. In PHP I will just include the PHP file that does the query but I cannot find that simple way in JSP. Trying to fix I came up with this method. When link is first clicked, it goes to servlet. Servlet processes it and posts results back to JSP. I'm using …

Member Avatar
Member Avatar
+0 forum 7

The End.