Quantcast
Channel: Active questions tagged servlets - Stack Overflow
Browsing index pages (787 articles)

How do I get the remote address of a client in servlet?

Is there any way that I could get the original IP address of the client coming to the server?I can use request.getRemoteAddr(), but I always seem to get the IP of the proxy or the web server.I would...

View Article


Polarion Java extension (servlet) which is calling from Velocity script (form...

I created a Polarion Java extension servlet which is calling from form extension Velocity script. I am using Polarion ALM 2512.I am using below java code for servletpackage...

View Article


HTTP Status 405: HTTP method POST is not supported by this URL [closed]

I've tried all methods available on StackOverflow and the internet, but nothing seems to workout as intended, below's a list of what I've tried doing:All declared methods in my java files are protected...

View Article

Controller and service layers: where to write, how much logic, and how to...

I have this setup:Controller layer (servlet for handling the requests)Service layer (for processing the needed service for model)DAO layer for interacting with db for particular modelFor instance, I...

View Article

How to change the default jdk in Netbeans 30

I am using Netbeans 30 as well as jdk 25.Whenever I am trying to run a servlet on Payara server, it says that Payara server cannot run on the default jdk 26 of Netbeans.I edited the netbeans.conf file...

View Article


Fix "No primary or single unique constructor found for interface...

I want to build a Register and login module for my application and ran into the error in the title.My login.html<!DOCTYPE html><html lang="en"...

View Article

How to store usernames and passwords in a very simply registration form using...

I understand how to use session cookies to pass a username and password from servlet to servlet but I am baffled on how to store successful registrations so that when someone new registers it checks it...

View Article

What's the purpose of "async-supported" in file 'web.xml'?

Consider:<servlet><description>xxx</description><servlet-name>xxx</servlet-name><servlet-class>com.xxx.yyy</servlet-class><async-supported>true</async...

View Article


updating jetty servlet 9.2.2 to 9.3.8 [closed]

I'm trying to update Jetty server and servlet from version 9.2.2 to version 9.3.8. After updating my pom.xml file, I get some errors like ServletContextHandler and ServletHolder are not found.Here is...

View Article


java.net.HttpRetryException: cannot retry due to server authentication, in...

We have two parts in our app:Server - provide REST servicesClient - consume them via Spring restTemplateIn addition to the HTTP status our server returns an HTTP body with JSON that describe error in...

View Article

Error 404 occurs when accessing pages within web-inf in the production...

Error 404 occurs when accessing pages within web-inf in the production environment, however the error does not occur in the development environment. The server is Tomcat 9. Java 8.I simply can't find...

View Article

Java Servlet HttpSession not maintained on Weblogic session forward

I come a long way asking this question here and am slightly out of options so I thought I would refer instead to this site which seems to always have an answer to most of my problems. Sorry for the...

View Article

Disable save button in Adobe PDF reader and hide menu bar in IE window

I am trying to render a PDF via servlet,using Itext for getting PDF file.Need to disable save ,print option in adobe pdf reader menu bar while other options like scroll,find should be there and in...

View Article


How to get host name with port from a http or https request

I have two applications deployed in a JBoss container (same unix box). If I receive a request from app1, I need to send a corresponding request for app2.An Example: If app1 requests:...

View Article

Image may be NSFW.
Clik here to view.

Eclipse Build Path Nesting Errors

I'm working on a simple JSP/Servlet/Tomcat webapp for my class. The professor asked us to use a folder structure that is slightly different than the default dynamic web project structure. Rather than...

View Article


Java servlet download filename special characters

I am writing a simple file download servlet, and I can't get correct filenames. I tried URLEncoding and MimeEncoding, the filenames as seen in existing answers, but none of them worked.The fileData...

View Article

How to properly configure Jakarta EE libraries in Maven pom.xml for Tomcat?

I have been trying in vain to implement tomcat 9's jakarta servlet as opposed to the previous javax.servlet implementation (as its my understanding that the jakarta package is the way forward). The...

View Article


java.lang.ClassCastException: class...

I took over some "legacy app" which is a SOAP web service based on WSDL files.As the app was not updated in years and failed to compile with anything but Java 8, I decided, I should try to somehow...

View Article

Image not displaying when running Java Servlet project on server (but works...

<img src="images/logo.png">I created a web project using HTML and Servlets (no JSP).When I open the HTML file directly using “Open in Browser,” the image displays correctly.But when I run the...

View Article

ServletException: ClassNotFoundException...

I set up a Websocket Server that is supposed to run a servlet which is created by a websocket servlet factory.However, whenever I try to reach the websocket via my favourite browser I get:HTTP ERROR:...

View Article
Browsing index pages (787 articles)


Latest Images