好的,所以情况很简单,所以我不确定问题是什么,我花了三个多小时进行令人沮丧的调试,但没有运气!
我从 GitHub(使用 git)克隆了一个 Maven 项目到 ~/workspace/MyCompany/MyProject。
然后我做了File-> Import...->Existing Maven Projects然后选择 MyProject 作为根目录。
它看起来像进口是成功的,但日食不承认任何阶级,甚至String和ArrayList!每当我右键单击并选择 时Open Declaration,都会收到以下错误消息:
打开编辑器时出现问题。原因:project_name 不存在。
我正在使用 eclipse Juno 和 m2e 1.2.0。m2e 是通过 Help->Install New Software... 安装的
是否可以在Struts 1中使用Tiles2?
我已按照迁移指南http://tiles.apache.org/migration/index.html上的说明进行操作
但是当我尝试访问我的操作时,我收到此错误:
org.apache.tiles.template.NoSuchAttributeException: Attribute 'body' not found.
Run Code Online (Sandbox Code Playgroud)
我有struts-config.xml:
<controller processorClass="org.apache.struts.tiles.TilesRequestProcessor"
maxFileSize="10M" tempDir="/tmp" />
<plug-in className="org.apache.struts.tiles.TilesPlugin">
<set-property property="definitions-config" value="/WEB-INF/tiles-defs.xml" />
</plug-in>
Run Code Online (Sandbox Code Playgroud)
和tiles-defs.xml
<definition name="mainTemplate" template="/common/templates/mainTemplate.jsp" />
<definition name="index" extends="mainTemplate">
<put-attribute name="body" type="string" value="/views/index/index.jsp" />
</definition>
Run Code Online (Sandbox Code Playgroud) 我只是尝试在带有struts提供标签的jsp页面中包含一个文本框.但它表现得很典型.
<html:text property="name" value=""></html:text>
<html:text property="name"></html:text>
因此,没有财产'value',它不起作用.请帮帮我们.
注意:使用tomcat 6.0
bean,逻辑工作正常,在html中也大部分工作正常.无线电,textarea,文本是导致问题的一些.
JSP文件
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Registration Form</title>
</head>
<body>
<html:text property="name"></html:text>
</body>
</html>
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception …Run Code Online (Sandbox Code Playgroud) 类SecureDispatchService这样从GWT:
@RemoteServiceRelativePath("dispatch")
public interface SecureDispatchService extends RemoteService {
Result execute( String sessionId, Action<?> action ) throws DispatchException;
}
Run Code Online (Sandbox Code Playgroud)
RemoteServiceRelativePath:
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface RemoteServiceRelativePath {
/**
* The relative path for the {@link RemoteService} implementation.
*
* @return relative path for the {@link RemoteService} implementation
*/
String value();
}
Run Code Online (Sandbox Code Playgroud)
测试代码非常简单:
package com.name.sbts.wbts.sm;
import net.customware.gwt.dispatch.client.secure.SecureDispatchService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
public class TestClass {
public static void main(String[] args) {
Class c = SecureDispatchService.class;
System.out.println(c.getAnnotation(RemoteServiceRelativePath.class));
System.out.println(c.getAnnotations().length);
}
}
Run Code Online (Sandbox Code Playgroud)
但结果不是这样的:
null …Run Code Online (Sandbox Code Playgroud) 错误消息:
SEVERE:异常将上下文初始化事件发送到类的监听器实例org.springframework.web.context.ContextLoaderListener org.springframework.beans.factory.parsing.BeanDefinitionParsingException:配置问题:无法从相对位置导入bean定义[security-config.xml ]
违规资源:ServletContext资源[/WEB-INF/spring/app-config.xml]; 嵌套异常是org.springframework.beans.factory.parsing.BeanDefinitionParsingException:配置问题:在Spring Security 3.2中不能使用spring-security-2.0.xsd或spring-security-3.0.xsd或spring-security-3.1.xsd模式.请将您的架构声明更新为3.2架构.
违规资源:ServletContext资源[/WEB-INF/spring/security-config.xml]
我的"security-config.xml"文件:
<beans xmlns:s="http://www.springframework.org/schema/security"
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security-3.2.xsd">
Run Code Online (Sandbox Code Playgroud)
我的pom.xml:
<properties>
<spring.version>4.1.4.RELEASE</spring.version>
<spring.security.version>3.2.5.RELEASE</spring.security.version>
<spring.ldap.version>2.0.2.RELEASE</spring.ldap.version>
<spring.data.oracle.version>1.1.0.RELEASE</spring.data.oracle.version>
...
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<version>${spring.security.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
<version>${spring.security.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
<version>${spring.security.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.ldap</groupId>
<artifactId>spring-ldap-core</artifactId>
<version>${spring.ldap.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-ldap</artifactId>
<version>${spring.security.version}</version>
</dependency>
...
</dependencies>
Run Code Online (Sandbox Code Playgroud)
为什么我收到此错误消息?可能涉及哪些其他文件?
我在为 xPos、yPos、nCounter 等属性生成 getter/setter 时遇到问题。平台是 Eclipse Luna、Java 1.7、Struts2...
当 Eclipse 生成
private xPos
getXPos()
setXPos(...)
Run Code Online (Sandbox Code Playgroud)
Lombok 将生成
getxPos()
setxPos(...)
Run Code Online (Sandbox Code Playgroud)
有没有办法告诉 Lombok 将每个第一个字符大写?
我打算在我的项目中集成 ORM,所以我使用 eclipse 的 JPA 项目从旧数据库中生成实体类。总共生成了 168 个实体类,这很好。但在某些约束条件下,例如nullable,unique不会自动生成。
例如,我需要这样的东西:-
@Column(name="USER_NAME",unique = true)
private String userName;
Run Code Online (Sandbox Code Playgroud)
但是在自动生成实体之后,代码中没有唯一约束。我怎样才能简单地实现这一目标?
任何建议都会有用。
我试图在Struts 2中使用tile 2.2.2.我在项目中包含了所有必需的jar(与tile,Struts2和Struts2 tiles插件相关).
commons-beanutils-1.8.0.jar
commons-collections-3.1.jar
commons-digester-2.0.jar
commons-fileupload-1.3.jar
commons-io-2.0.1.jar
commons-lang-2.4.jar
commons-lang3-3.1.jar
commons-logging-1.1.3.jar
freemarker-2.3.19.jar
javassist-3.11.0.GA.jar
ognl-3.0.6.jar
slf4j-api-1.5.8.jar
slf4j-jdk14-1.5.8.jar
struts2-core-2.3.15.jar
struts2-tiles-plugin-2.3.15.jar
tiles-api-2.2.2.jar
tiles-compat-2.2.2.jar
tiles-core-2.2.2.jar
tiles-jsp-2.2.2.jar
tiles-servlet-2.2.2.jar
tiles-template-2.2.2.jar
xwork-core-2.3.15.jar
Run Code Online (Sandbox Code Playgroud)
Tiles.xml
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE tiles-definitions PUBLIC
"-//Apache Software Foundation//DTD Tiles Configuration 2.0//EN"
"http://tiles.apache.org/dtds/tiles-config_2_0.dtd">
<tiles-definitions>
<definition name="baseLayout" template="/BaseLayout.jsp">
<put-attribute name="title" value="" />
<put-attribute name="header" value="/Header.jsp" />
<put-attribute name="menu" value="/Menu.jsp" />
<put-attribute name="body" value="" />
<put-attribute name="footer" value="/Footer.jsp" />
</definition>
<definition name="/welcome.tiles" extends="baseLayout">
<put-attribute name="title" value="Welcome" />
<put-attribute name="body" value="/Welcome.jsp" />
</definition>
<definition name="/employee.tiles" …Run Code Online (Sandbox Code Playgroud) 在服务器上部署应用程序时出现错误日志
Dec 19, 2013 5:26:00 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre7\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Program Files\Dell\DW WLAN Card;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x86;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x64;C:\Program Files\WIDCOMM\Bluetooth Software\;C:\Program Files\WIDCOMM\Bluetooth Software\syswow64;C:\Program Files\Java\jdk1.7.0_25\bin;C:\Program Files\TortoiseSVN\bin;C:\MATLAB7\bin\win32;C:\Program Files\MATLAB\R2011a\runtime\win64;C:\Program Files\MATLAB\R2011a\bin;.
Dec 19, 2013 5:26:01 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:StrutsDemo' did not find a matching property.
Dec 19, 2013 5:26:01 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Dec …Run Code Online (Sandbox Code Playgroud) 我正在尝试在我的spring项目的jsp页面中使用hasPermission.我已经在我的控制器/服务类的方法中使用它没有问题.阅读文章:
从官方文档中,我了解到,为此,我将需要实现从DefaultPermission派生的类,该类将从自定义AclService类加载.
我的问题是我找不到任何关于如何实现所有类的信息,甚至不知道这种方法是否是唯一的方法,或者我是否以正确的方式理解了主题(官方文档对此主题非常简短,在互联网的其余部分,我找不到更多的信息).
任何人都可以指出我在正确的方向吗?也许指出一些教程或代码示例.
UPDATE
从StackOverflow读取其他主题,我发现了这个问题:
Run Code Online (Sandbox Code Playgroud)This is what I have done. I created my own permission evaulator:
> public class MyPermissionEvaluator implements PermissionEvaluator {
> ...
> }
Run Code Online (Sandbox Code Playgroud)
Run Code Online (Sandbox Code Playgroud)Then I configured spring to use that evaulator via
> <beans:bean id="expressionHandler"
> class="org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler">
> <beans:property name="permissionEvaluator" ref="permissionEvaluator"/>
> </beans:bean>
>
> <beans:bean id="webExpressionHandler"
> class="com.bulb.learn.webapp.security.CustomWebSecurityExpressionHandler">
> <beans:property name="permissionEvaluator" ref="permissionEvaluator"/>
> </beans:bean>
>
> <beans:bean id="permissionEvaluator" class="my.domain.MyPermissionEvaluator" />
Run Code Online (Sandbox Code Playgroud)
Run Code Online (Sandbox Code Playgroud)That way all expression handlers have access to my evaulator. Then, in …