我的页面中有一个命令链接,如下所示:
<h:commandLink value="Add user" action="add?faces-redirect=true" />
Run Code Online (Sandbox Code Playgroud)
当我点击它,它会转到网址:
http://localhost:8080/myapp/faces/add.xhtml
Run Code Online (Sandbox Code Playgroud)
但我希望网址是:
http://localhost:8080/myapp/add
Run Code Online (Sandbox Code Playgroud)
怎么做 ?
我正在使用spring 3,jsf 2
这是我的web.xml:
<?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_2_5.xsd"
id="WebApp_ID" version="2.5">
<display-name>myapp</display-name>
<!-- Add Support for Spring -->
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<listener>
<listener-class>
org.springframework.web.context.request.RequestContextListener
</listener-class>
</listener>
<!-- Change to "Production" when you are ready to deploy -->
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>
<!-- Welcome page -->
<welcome-file-list>
<welcome-file>faces/users.xhtml</welcome-file>
</welcome-file-list>
<!-- JSF mapping -->
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- Map …Run Code Online (Sandbox Code Playgroud) 嗨,我想一起使用以下技术:
我的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_2_5.xsd"
version="2.5">
<display-name>appName</display-name>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<listener>
<listener-class>
org.springframework.web.context.request.RequestContextListener
</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
classpath:META-INF/spring/applicationContext.xml
</param-value>
</context-param>
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>
<welcome-file-list>
<welcome-file>/</welcome-file>
</welcome-file-list>
<context-param>
<param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
<param-value>resources.application</param-value>
</context-param>
<listener>
<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
</listener>
<context-param>
<param-name>javax.faces.FACELETS_SKIP_COMMENTS</param-name>
<param-value>true</param-value>
</context-param>
<servlet>
<servlet-name>Resource Servlet</servlet-name>
<servlet-class>com.icesoft.faces.webapp.CompatResourceServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Resource Servlet</servlet-name>
<url-pattern>/xmlhttp/*</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>
</web-app> …Run Code Online (Sandbox Code Playgroud) 我在Windows Server 2008 R2上运行tomcat 7.0.33 (我安装了tomcat作为windows服务)
jdk1.6.0_25 64-bitTomcat选项:
C:\Program Files\Java\jre6\bin\server\jvm.dll
顺便说一句,我在jre里面没有客户端文件夹)最大内存池: 2000 MB
当我检查服务器状态时,我可以看到服务器正在使用我配置的内存.
环境变量(SYSTEM VARIABLES)配置:
C:\Program Files\Java\jdk1.6.0_25...;%JAVA_HOME%\bin;....我是否还需要添加CATALINA_HOME和JAVA_OPTS系统变量?
问题:我有两个Web应用程序APP1,*APP2*,当我分别部署每个,我可以找到内存使用的
APP1 = 198 MB APP2 = 104 MB
有关申请的信息:
APP1,APP2:Spring Maven应用程序,在库中包含其他小型maven spring应用程序.
APP1:包含web2服务,APP2使用它们.
如果我试图在同一个tomcat实例上部署它们,我总是得到
java.lang.OutOfMemoryError: PermGen space
Run Code Online (Sandbox Code Playgroud)
请告知可能导致此问题的原因.
假设你有像这样的字符串:
String longStr="someText1@someText2@someText3@someText@someText4@someText5@someText6@someText7@someText8@someText9@someText10@someText11@someText12@someText13@someText14";
Run Code Online (Sandbox Code Playgroud)
如何获得的指数10日将发生@在上面的字符串的字符?
我需要索引从该索引分割到结束.
我正在使用JSF2/Primefaces,我想知道如何使用 jsf 或 primefaces 实现超时回调?
我想将 ajax 请求的超时设置为 30 秒,如果请求超时,则执行回调操作。
问候所有我想用 javaScript 验证电子邮件,我需要使用最佳模式进行匹配 请建议我一个好的模式
问候所有,我有一个文本,可能包含以下<a></a>标签:
hello this is a link <a href="www.google.com"> www.google.com </a> please visit it.
Run Code Online (Sandbox Code Playgroud)
我想删除这些标记并将它们保持在它们之间:
hello this is a link www.google.com please visit it.
Run Code Online (Sandbox Code Playgroud)
, 怎么做 ?
我想整合Spring 3,Web Flow 2,JSF 2,我需要你向我推荐一个好的教程或示例,在此先感谢.
更新:
我使用了以下示例,它没有任何问题与我一起工作正常:
http://www.mkyong.com/jsf2/jsf-2-0-spring-hibernate-integration-example/
但它不使用弹簧网络流程,我不知道这种方法是否有任何问题.
java ×3
java-ee ×3
jsf-2 ×3
jsf ×2
regex ×2
spring ×2
friendly-url ×1
icefaces ×1
javascript ×1
jsf-2.2 ×1
jsp ×1
primefaces ×1
svn ×1
svnignore ×1
tomcat ×1
tomcat7 ×1
tortoisesvn ×1