servlets

How to set the email protocol in JavaMail

If I need to get inbox messages by passing request from servlets to javamail API , how can I know the protocol in which to retrieve inbox messages? Do I have to state the protocol in request URL? I've already checked in gmail, where they haven't stated any protocol, then How can I get inbox messages based on particular protocol like: P...

Servlet request getparameter's performance

Hi, I noticed that my app is very slow sometimes, so I've done some tests. It's a very simple web app. One servlet gets some parameters than stores them. Everything's fine except one thing. It takes too long to get a parameter for the first time. It doesn't matter which parameter I try to get, but for the first time it is very slow. The...

How to develop JSP/Servlets Web App using MVC pattern?

I'm developing a JSP/Servlet web app (no frameworks). I want to use MVC pattern. I am going to design my project like this: Controller: a servlet that reads a request, extracts the values,communicates with model objects and gives information to a JSP page. View: JSP Pages. Model: Java Classes / Java Beans .. etc. The problem: Index...

Servlet stops without giving any exception

Hi, I have implemented a Servlet hosted on Tomcat 6 server on Mandriva Linux. I have been able to make the client communicate with the Servlet. In response to a request the Servlet tries to instantiate a another class (named KalmanFilter) located in the same directory. The KalmanFilter tries to create four Matrices (using Jama Matrix pac...

java.lang.ClassCastException: $Proxy99 cannot be cast

Hi, I am using JBoss4.2.2 and java6. The deployed ear's name is apa.ear In a servlet I have the following code line: placeBid = (PlaceBid) context.lookup("apa/" + PlaceBid.class.getSimpleName() + "/remote"); I have a generated jboss-app.xml like this: <jboss-app> <loader-repository>apa:app=ejb3</loader-repository> </jboss-app>...

Basic Tomcat Servlet error.

package mypackage; import java.io.*; import javax.servlet.http.*; import javax.servlet.*; public class Hello extends HttpServlet { public void doGet (HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { PrintWriter out = res.getWriter(); out.println("Hello, world...

Servlet xxx is not available

In the web.xml of my web app I have configured the server as following: <servlet> <servlet-name>SOS</servlet-name> <servlet-class>cn.SOS</servlet-class> <init-param> <param-name>configFile</param-name> <param-value>/WEB-INF/conf/sos.config</param-value> </init-param> <init-param> <param-name>dbConfigFile</param-name>...

servlert : The requested resource is not available.

Whenever I entered URL for opening a jsp page ..i am getting "The requested resource (/page/form.jsp) is not available." error Page and in my file structure WebContent->WEB-INF ->page->form.jsp ...

how can a servlet in one jvm communicate with servlet in another jvm

can this be solved simply by specifying the complete url of the servlet in the RequestDispatcher? ...

How to send HttpServletResponse in the PrintWriter having an HTML structure to a jsp

I am trying to send a table in html code to a jsp using response.setContentType("text/html"); PrintWriter out = response.getWriter(); out.println("<html>")..... then using response.sendRedirect(jsp name) to send the table to the jsp; But this is never worked with me and I have a doubt that the printwriter has a specific manipulati...

the PrintWriter servlet Buffer and displayind data from a jsp

Hello all, I need really your help please. What I do is to build a table in html tags in my servlet then when trying to send this table to a servlet for the display using: Response.sendRedirect this did not work. I have an error but I don't know the cause. I search to how do it since I use: response.setContentType("text/html"); PrintW...

Which option do you like the most?

I need to show a list of movies ordered by the date they were registered in the system and the amount of comments users have made about them. E.g: Title | Register Date | # of comments Gladiator | 02-01-2010 | 30 Matrix | 01-02-2010 | 20 It is a web application that follows MVC. So, I have the object "Movie", there is a...

Java Web App: Passing form parameters across multiple pages

Hi, what is the best practice or best way of passing form parameters from page to page in a flow? If I have a flow where a user enters data in a form and hits next and repeats this process until they get to an approval page, what ways could I approach this problem to make the retention of data as simple as possible over the flow? I gue...

servlet does not envoke when I call a from method.

My web.xml is like <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"&gt; <display-name>sample</display-name> <servlet> <servlet-name>Sampleclass</serv...

ide and application server for java

Which is the best application server and the best ide for an absolute beginner for locally hosting servlets ...

passing data from a servlet to javascript code in an Ajax application ?

I have a simple jsp/servlet application and I want to add AJAX feature to this app. I use JQuery , but it doesn't matter what javascript framework I use. This is my code: <script type="text/javascript"> function callbackFunction(data){ $('#content').html(data); } $('document').ready(function(){ ...

Exception in JEE application Email Notification Pattern

We have spring 3.0.x based application, we use SimpleMappingExceptionResolver which sends emails on an exception, when the exception happens within the DispatcherServlet. This gives us following flexibility: Subject can include who the logged in user is, so that we can send personalized email to the user Subject also includes the ser...

Can FileOutputStream() take a relative path as an argument

I am creating a FileOutputStream object. It takes a file or String as an argument in its constructor. My question is, can I give it a relative URL as an argument for the location of a file, it doesn't seem to work, but I am trying to work out if this is possible at all (if not I will stop trying). If it is not possible, how can I (fro...

How to upload file outside web server?

I want to upload files outisde web server like in d d drive into servlets, I but I'm not able to upload them. What I have to do to make functionality like this enable in Tomcat 6.0? ...

How can I get a the host name (with port) that a servlet is at.

I thought ServletContext might provide a method. Does the getAttribute() method of ServletContext provide any help i.e. is there an attribute name (maybe "host", "port") that will be of help. The reason for this is I want my application to run wherever it is deployed, and at one point I have to allow a user to click a link that points t...