Im not sure that its possible to do what I want to accomplish. I want to map one single servlet to two different URL.
I want both http://10.0.0.1/a and http://10.0.0.1/b to map to the same servlet.
I know its possibe to do the following in web.xml;
<servlet-mapping>
<servlet-name>ServletName</servlet-name>
<url-pattern>/b</...
Hi there,
I want a Servlet to handle requests to files depending on prefix and extension, e.g.
prefix_*.xml
Since mapping on beginning AND end of request path is not possible, I have mapped all .xml requests to my Servlet.
The question now is: how can I drop out of my servlet for XML files not starting with "prefix", so that the reques...
I have a dynamic text file that picks content from a database according to the user's query. I have to write this content into a text file and zip it in a folder in a servlet. How should I do this?
...
have anyone tried this, create openid4j servlet and try authenticate with google openid? i tried it and fail and so want to get confirmation from you all. i able to authenticate with yahoo_email and myopenid.com
...
How can I upload image with JavaScript from Open Flash Chart 2 to servlet? What I have to implement so that I can save that image to my server ?
...
Is it possible to pass a request param containing the encoding to a filter which checks if there is a value and sets it as character encoding? I have read that calling the method to setting the character encoding should be done before reading the request params. Is there maybe another way to do this?
Edit: Java / Java Server Pages
...
Having a hard time figuring out how to send dynamic data to a web-app's user without having to create a file & using a dynamic link to static content using java technology. (The main reasons for avoiding the file creation on disk are security and speed)
This is something I have previously done in python, but this web-app is intended to ...
I'm writing a testing utility- I want to show multiple finished HTML "pages" in a single browser window.
Is this possible? I'm using Java Servlets.
For example, normally the user goes to a utility screen, fills in a bunch of fields and POSTS this to my servlet, which builds up a full HTML stream based on their input and writes it to Ht...
I have a servlet which does some error checking and if something is wrong I will typically do this:
response.sendError(403, "My message")
return;
I don't want to throw an exception from the servlet - because I would like to conform with HTTP status codes.
In the web.xml I have configured the following:
<error-page>
<er...
I work with different servers and configurations. What is the best java code approach for getting the scheme://host:[port if it is not port 80].
Here is some code I have used, but don't know if this is the best approach.
(this is pseudo code)
HttpServletRequest == request
String serverName = request.getServerName().toLowerCase();
Str...
Hi, I´ve installed Tomcat and I've been testing it: I wrote some .html and .jsp files and tried then in the server. They semm to work correctly together. For example: these files I'm trying allow me to upload a file to the server and writes its name in a database (mysql). Once this is done I have a button that allows me to upload another...
I'm currently working on building a java web app. I've been looking to use Spring and Hibernate so I get some proper exposure to them, but I'm just getting burned out reading and learning about them. If I go ahead and build it with JSP and Servlets on a MySQL back end, what kind of levels of code reuse would I be looking at? I imagine th...
Hi,
I'm trying to display an attribute value of ArrayList from JSP set in session scope in servlet as:
hs.setAttribute("Attr",arr); //where hs is reference to HttpSession and arr is of type of ArrayList
But when I invoked simple tag with the EL expression as optionList attribute value of advice tag in JSP as:
<%@ taglib prefix="c" ...
I am currently writing a Comet application which requires me to send chunks of data at a time on a persistent connection. However, I'm having trouble flushing the message to the client before closing the connection. Is there any reason the PrintWriter.flush() method is not behaving like I think it should?
This is my Tomcat Comet imple...
I need to split out parameters given a URL string.
I got the url value using request.getHeader("Referer") e.g.:
string rr=request.getHeader("Referer");
<%= rr %>
i got the url as http://www.sun.com/questions?uid=21&value=gg
Now I stored that url in as string how do I get the value parameter value as uid=21 and value=gg
Please r...
Is there a way to get the URI of a JSP that sent a particular GET/POST request to a Servlet? I know of the request.getRequestURI() function within a Servlet, but that is just returning the URI of the Servlet itself.
For example:
Let's say that index.jsp sent the request to the Servlet SampleServlet. I want to get the URI of the ind...
I have Application written with GWT 1.7. I have one page where I upload file to the remote server that is on different domain. So, when I do Post to the server files goes to the server but when it's time to get response I'm getting null in following function:
Servlet:
...
resp.setStatus(HttpServletResponse.SC_CREATED);
resp.getWriter()...
I'm trying to zip a large number of pdf files (stored as BLOBs in the DB) and then return the zip as an attachment to the user.
What's the best way to do this without running into memory issues?
Another note: I actually need to merge some PDFs prior to adding them to the ZipOutputStream. Therefore, a couple PDFs will need to be store...
Hi,
I'm working on an application. I have a servlet (writeDataBase.class) that writes some information in a database. This is working fine. My folder structure looks like: webapps/HelloWord/web-inf/classes. In folder 'classes' is where the file writeDataBase.class is placed.
web.xml looks like:
<servlet>
<servlet-name>HelloWord</serv...
I am writing an application that integrates Geoserver with a custom component, intended to be hosted on a single servlet engine. Both are Maven based projects, and I would like to stay in Maven land to package it all into a nice distributable. The general idea I have is to add another module to my application that packages the applicatio...