我遇到了下一个问题:我正在尝试通过startup.bat手动启动Tomcat,但似乎没有显示任何结果,然后我尝试运行shutdown.bat并且控制台显示下一个:
D:\apache-tomcat-7.0.35\bin>startup.bat
Using CATALINA_BASE: "D:\apache-tomcat-7.0.35"
Using CATALINA_HOME: "D:\apache-tomcat-7.0.35"
Using CATALINA_TMPDIR: "D:\apache-tomcat-7.0.35\temp"
Using JRE_HOME: "C:\Program Files\Java\jdk1.6.0_31"
Using CLASSPATH: "D:\apache-tomcat-7.0.35\bin\bootstrap.jar;D:\apache-tomcat-7.0.35\bin\tomcat-juli.jar"
D:\apache-tomcat-7.0.35\bin>shutdown.bat
Using CATALINA_BASE: "D:\apache-tomcat-7.0.35"
Using CATALINA_HOME: "D:\apache-tomcat-7.0.35"
Using CATALINA_TMPDIR: "D:\apache-tomcat-7.0.35\temp"
Using JRE_HOME: "C:\Program Files\Java\jdk1.6.0_31"
Using CLASSPATH: "D:\apache-tomcat-7.0.35\bin\bootstrap.jar;D:\apache-tomcat-7.0.35\bin\tomcat-juli.jar"
Invalid initial heap size: -Xms256m -Xmx512m -XX:MaxPermSize=256m
Could not create the Java virtual machine.
Run Code Online (Sandbox Code Playgroud)
catalina.bat是原创的,我也检查了所有的pathes和opts(即JAVA_HOME,JRE_HOME,CATALINA_BASE,CATALINA_HOME,CATALINA_TMPDIR).tomcat版本是7.0.35 java v 1.6
我写了下一个代码:
public void delete(MyType instance) {
List<MyType> myList = this.getAll();
Cookie[] cookies = request.getCookies();
List<Cookie> cookieList = new ArrayList<Cookie>();
cookieList = Arrays.asList(cookies);
for(Cookie cookie:cookieList) {
if(Long.valueOf(cookie.getValue()) == instance.getId()) {
cookieList.remove(cookie);
}
}
myList.remove(instance);
cookies = (Cookie[]) cookieList.toArray();
}
Run Code Online (Sandbox Code Playgroud)
问题是下一个:当我从cookielist中删除cookie时,我如何将更新的cookielist(没有删除的cookie)放回客户端?请求或响应没有任何*.setCookies();方法.或cookie会自动更新?最好的祝福.
当我尝试启动我的应用程序时,控制台显示下一个堆栈跟踪:
java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
Run Code Online (Sandbox Code Playgroud)
我已经阅读了同样的问题,但是没有spring-web jar,但是在我的pom.xml中我已经包含了spring依赖项,问题仍然存在:
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring.version}</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)
这是web.xml文件(只是为了确定):
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
classpath:/context/webContext.xml
</param-value>
</context-param>
<context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>classpath:log4j.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<servlet>
<servlet-name>springServlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value></param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>springServlet</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<filter>
<filter-name>springSecurityFilterChain</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<session-config>
<session-timeout>30</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>login.jsp</welcome-file>
</welcome-file-list>
Run Code Online (Sandbox Code Playgroud)
我干净..,干净的tomcat工作目录......,我用项目清理工作区 - >干净..但没有任何帮助..我在这样的绝望...
更新=============经过一些操作和魔术:)我成功没有这样的异常,但下一个出现:
java.lang.ClassCastException: org.springframework.web.filter.DelegatingFilterProxy cannot be cast to javax.servlet.Filter
Run Code Online (Sandbox Code Playgroud) 在实施jasig-CAS时我遇到了下一个问题:我想实现注销.目前它工作正常,但我希望CAS服务器在注销到请求来自的服务器后重定向用户(例如,http://localhost:8080/myApp).我试图在安全上下文中添加"服务",但这里没有发生任何事情是我的春季安全上下文:
<security:logout logout-url="/logout"
logout-success-url="https://localhost:9543/cas-server-webapp-3.4.10/logout?service=http://localhost:8080/myApp"
invalidate-session="true" />
Run Code Online (Sandbox Code Playgroud)
所有配置和程序均取自本手册.
我有以下问题:当我在模型中放入一些数据时,我想在视图部分检查一些复选框,它们等于我对象中的字段名称.这是HTML代码:
<div class="myDiv">
<div class="divClass">
<input type="checkbox" name="someData" value="0" id="id1">
<label for="id1">Field1</label>
</div>
<div class="divClass">
<input type="checkbox" name="someData" value="1" id="id2">
<label for="id2">Field2</label>
</div>
<div class="divClass">
<input type="checkbox" name="someData" value="2" id="id3">
<label for="id3">Field3</label>
</div>
<div class="divClass">
<input type="checkbox" name="someData" value="3" id="id4">
<label for="id4">Field4</label>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
这里是jstl pseudo_code,我想获得:
<c:forEach var="field" items="${list.fields}">
<c:if test="${field.name=='FIELD(1-4)'}">CHECK_THE_APPROPRIATE_CHECKBOX
</c:if>
</c:forEach>
Run Code Online (Sandbox Code Playgroud)