如果是这样,你该怎么做?。
是的,听起来像是我的最后一个问题。本质上也是同样的问题。我有一个@javax.servlet.annotation.WebFilter
,当直接打包到war中时,它可以很好地工作。现在我想将过滤器移到库中。但如果我这样做,就不会再叫它了。
我有什么需要注意的陷阱吗?还是根本不可能?
如果是这样,你该怎么做?。
是的,听起来像是我的最后一个问题。本质上也是同样的问题。我有一个@javax.servlet.annotation.WebFilter
,当直接打包到war中时,它可以很好地工作。现在我想将过滤器移到库中。但如果我这样做,就不会再叫它了。
我有什么需要注意的陷阱吗?还是根本不可能?
设置<;web应用元数据完成=“false”>代码>。
这意味着此web应用程序的元数据不限于此特定的xml(以及web应用程序中的类),而是可以由第三方库使用元数据。
还可以看看“网络碎片”。您可以在jar的META-INF
中定义web片段.xml
,并在那里映射所有servlet和过滤器。
只需在JAR项目的/META-INF
文件夹中放入一个与web.xml
兼容的空Servlet 3.0文件。
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
id="yourProjectId" version="3.0">
</web-app>
Servlet 3.0容器默认情况下会扫描JAR中是否存在/META-INF/web.xml
文件,然后扫描JAR中的所有类中是否存在Servlet 3.0注释。不需要其他设置。
JSF 2.0在/META-INF/faces-config.xml
中也有类似的技术。
I ve got an index.jsp with [snip] <% String name = request.getParameter("name"); String pass = request.getParameter("pass"); String globalname = "webeng"; String globalpass = "2009"; ...
I am using Tomcat to host JSP and using IIS 7.0 to host aspx (C# + .Net 3.5 + VSTS 2008), and I have some session transfer issue from JSP page to ASPX page. JSP page is in one domain and all other ...
I am setting the value(kind of default value) for a drop down select value from action class in a page(given below). When the page loads the value is beig displayed but the other elements of the ...
I have a requirement where in the JSP page itself is created by the user and stored in the database. When viewing results we need to render this JSP to the client, evaluating all tags inside this JSP. ...
I m essentially trying to do the following on a Java/JSP-driven web site: User supplies a password Password is used to build a strongly-encrypted archive file (zip, or anything else) containing a ...
I m setting up an existing application on a new Tomcat 5.5 server connecting to a Postgres database (running on Debian Lenny). When I access it I get a series of stack traces with the following root ...
I have an ArrayList and i am trying to display it in a table ..... ArrayList rows = .... ..... <table cellspacing="1" cellpadding="4" border="3"> <tr> <TH>...
I m trying to deploy a java application to appspot (google appengine). I m new to java, so bear with me. When I run the application locally from eclipse, it runs fine. After uploading it to google ...