servlet

Dispatcher for Filter Mapping

匿名 (未验证) 提交于 2019-12-03 03:06:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have an app written for Servlet Spec 2.4 with an old webserver designed for Servlet Spec 2.3. The web.xml file has the following syntax: <filter-mapping> <filter-name>sitemesh</filter-name> <url-pattern>*.action</url-pattern> <dispatcher>REQUEST</dispatcher> <dispatcher>FORWARD</dispatcher> </filter-mapping> How can I re-write this mapping to be servlet 2.3 compliant? 回答1: You can just remove the <dispatcher> entries. The Servlet 2.3 filter by default dispatches on everything and that's just okay. Sitemesh even mentions at its own site

java.lang.NoSuchFieldError: REFLECTION

匿名 (未验证) 提交于 2019-12-03 03:04:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm creating a project with CXF and use MTOM with some security (I don't know if that information is relevant). When I tried initialize my server I recived that error: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'example': Invocation of init method failed; nested exception is java.lang.NoSuchFieldError: REFLECTION This is my cxf-servlet.xml file: <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema

java.lang.ClassNotFoundException: org.springframework.web.servlet.DispatcherServlet in spring project

匿名 (未验证) 提交于 2019-12-03 03:04:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: one hello.jsp web.xml is <?xml version="1.0" encoding="UTF-8"?> http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0"> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> <!-- The front controller of this Spring Web application, responsible for handling all application requests --> <servlet> <servlet-name>dispatcher</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <!-- Map all requests to the DispatcherServlet

Calling Servlet for Facebook API to get Access Token

匿名 (未验证) 提交于 2019-12-03 03:04:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: QUESTION EDITED: I am using Captain Casa framework. I have a button that will open a new tab and go to facebook login page. public void goTofbPage(javax.faces.event.ActionEvent event){ FBConnection fbConnection = new FBConnection(); setBrowserUrl(fbConnection.getFBAuthUrl()); m_browserTrigger.trigger(); } If user logged on successfully, it will redirect to my page together with the user's data. In order to get the accessToken from the user I used HttpServlet. But how am I able to call this HttpServlet? Do I really need to call it or it will

How can my Servlet receive parameters from a multipart/form-data form?

匿名 (未验证) 提交于 2019-12-03 03:03:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a page that has this piece of code: <form action="Servlet" enctype="multipart/form-data"> <input type="file" name="file"> <input type="text" name="text1"> <input type="text" name="text2"> </form> When I use request.getParameter("text1"); in my Servlet it shows null. How can I make my Servlet receive the parameters? 回答1: All the request parameters are embedded into the multipart data. You'll have to extract them using something like Commons File Upload: http://commons.apache.org/fileupload/ 回答2: Use getParts() 回答3: Pleepleus is right,

vaadin 7 URL parameter

匿名 (未验证) 提交于 2019-12-03 02:59:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am not too familiar with vaadin 7 and I can not figure out this. I tried to use google but no useful result. My question is very simple. How can I get the request url parameters in my UI class? My url has a parameter: host/myvaadinapp/?code=erefdvdfgftf... The url parameter comes from facebook after user logged in (OAuth) and I need to handle the value of code url parameter in my code. I tried to do these: @PreserveOnRefresh public class AdminUi extends UI { @Override protected void init(VaadinRequest request) { ... System.out.println(

CXF jaxws endpoint relative publish address

匿名 (未验证) 提交于 2019-12-03 02:56:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am having a lot of difficulty trying to use a relative publish address in my CXF web service endpoint configuration. I have a simple Java-first JAX-WS project with the following configuration files: applicationContent-cxf.xml: <beans xmlns=...> ... <jaxws:endpoint id="helloWorldService" implementorClass="org.helloworld.ws.HelloWorldServiceImpl" implementor="#helloWorldServiceImpl" <!-- spring managed --> endpointName="sayHello" address="HelloWorldService"/> </beans> web.xml: <web-app> <context-param> <param-name>contextConfigLocation<

How to send data to servlet using ajax without a submitting form

匿名 (未验证) 提交于 2019-12-03 02:52:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I am new with servlet, I am able to get data from the servlet but not able to send data to it and I want to do this without using a submitting form, can i get some help please on the click of the button it will go to the servlet and return the text but not the value send to it This is my index.jsp <!DOCTYPE html> <html lang = "en" > <head> <title> SO question 4112686 </title> <script src = "http://code.jquery.com/jquery-latest.min.js" ></script> <script> $ ( document ). ready ( function () { $ ( '#somebutton' ). click ( function ()

@WebServlet annotation not recognized; init doesn&#039;t run

匿名 (未验证) 提交于 2019-12-03 02:52:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to learn annotations. I currently have a webapp that runs an init() when the app is started in Tomcat. The following code works... web.xml: <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0"> <servlet> <servlet-name>MainServlet</servlet-name> <servlet-class>com.company.Main</servlet-class> <load-on-startup>1</load-on

Error: /login.xhtml Not Found in ExternalContext as a Resource

匿名 (未验证) 提交于 2019-12-03 02:51:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I'm using JBoss 7.1 with JSF 2.1/Prime Faces and keep running into the error listed in the title. I've tried many of the suggestions made here and all end up with the same error. File structure is: WEB - INF faces login . xhtml I have the following in web.xml: <display-name> clientAccountManager </display-name> <servlet> <servlet-name> Faces Servlet </servlet-name> <servlet-class> javax.faces.webapp.FacesServlet </servlet-class> </servlet> <servlet-mapping> <servlet-name> Faces Servlet </servlet-name> <url-pattern> /faces/* </url