我有以下课程
package com.test;
public class SomeClass {
public enum COLOR {RED,BLUE}
}
Run Code Online (Sandbox Code Playgroud)
我想COLOR在JSP中访问枚举值.我尝试了以下代码,但它不起作用.
<s:property value="@com.test.SomeClass.COLOR@RED"/>
<s:property value="@com.test.SomeClass@COLOR.RED"/>
Run Code Online (Sandbox Code Playgroud)
以前有人问过这个问题吗?[我已经在struts.xml中启用了静态方法访问]
我试图让我的iOS7应用程序在iOS8上工作,我看到它UISearchController取代了UISearchDisplayControlleriOS8.
当然我可以使用UISearchController而不是UISearchDisplayController,但我的应用程序不再适用于iOS7.
如何让我的应用程序在两个iOS版本上运行?我是否需要为iOS8制作另一个故事板?
提前致谢
我可以使用此标记显示特定字段的错误:
<s:fielderror fieldName="myField" />
Run Code Online (Sandbox Code Playgroud)
但除了显示错误消息之外,我还想以红色突出显示该字段.为此,我需要知道字段是否生成错误,然后将错误类添加到此字段.
如何检查特定字段是否生成错误?
我们有一个查询:
List<Book> books = session.createQuery(
"from Book b where :x member of b.bookCategories")
.setParameter("x", crimeStory)
.list();
Run Code Online (Sandbox Code Playgroud)
但是在执行此查询时,我们收到了一条警告消息:
警告10:19:41弃用:HHH90000016:在HQL/JPQL查询[null.elements]中发现使用不推荐使用的'集合属性'语法; 使用集合函数语法代替[elements(null)].
我试图将查询更改为:
List<Book> books = session.createQuery(
"from Book b where ? in elements(b.bookCategories)")
.setParameter(0, crimeStory).list();
Run Code Online (Sandbox Code Playgroud)
但警告信息仍在那里.
请帮我解决这个警告.
P/s:我们目前正在使用Hibernate 5.0.2
Maven 3.5.0在控制台输出中引入了着色.
这是一个很酷的功能,但我不喜欢一些默认的颜色选择,例如密集的蓝色INFO看起来太分散注意力.
有可能以某种方式定制颜色吗?
我有一个HashMapJSP页面上的对象.
HashMap<Integer,Gift_product> gift_hm = new HashMap<Integer,Gift_product>();
gift_hm.put(17,new Gift_product("doll",67));
Run Code Online (Sandbox Code Playgroud)
现在我需要迭代它并在JSP上显示内容.本Gift_product类包含两个字段:name和price.
JSP输出应该是
serial no. product name price
17 Doll 67
Run Code Online (Sandbox Code Playgroud)
我怎样才能实现它?
我有一个登录页面,用户需要在其中输入以下信息VIN号码,电子邮件,邮政编码和accessCode,他们将从不同的应用程序中获取.
因此,要验证用户,我需要自定义UserDetailsService类中的所有信息,然后将调用一个过程来验证用户.
但是当我实现UserDetailsService下面这样的时候,我看到了
@Component
public class LoginService implements UserDetailsService {
@Autowired
LoginStoredProcedureDao loginStoredProcedureDao;
public Map<String, Object> verifyLogin(LoginDetails details) {
return loginStoredProcedureDao.verifyLogin(details);
}
@Override
public UserDetails loadUserByUsername(String username)
throws UsernameNotFoundException {
// TODO Auto-generated method stub
//verifyLogin();
return null;
}
}
Run Code Online (Sandbox Code Playgroud)
loginDetails对象如下所示
public class LoginDetails {
String vin;
String email;
String zipcode;
String accessCode;
}
Run Code Online (Sandbox Code Playgroud)
在上述情况下如何使用弹簧安全.在这里,用户需要提供所有信息以验证他自己.
我在webapp中使用ehcache,其版本在 Tomcat实例上并行部署.这是在不停止应用程序的情况下部署新版本的便捷方法.
但是我有这样一个问题要继续:即使我给缓存和磁盘存储不同的名称,取决于webapp的版本,所有缓存在停止一个实例时停止.
我的配置是:
<?xml version="1.0" encoding="UTF-8"?>
<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="ehcache.xsd" name="mywebapp-${project.version}_build_${buildNumber}">
<defaultCache
maxElementsInMemory="1000"
maxElementsOnDisk="10000"
eternal="false"
timeToLiveSeconds="300"
timeToIdleSeconds="300"
overflowToDisk="true"
diskPersistent="false"
memoryStoreEvictionPolicy="LRU"
statistics="true"
/>
<cache
maxElementsInMemory="1000"
maxElementsOnDisk="10000"
name="org.hibernate.cache.internal.StandardQueryCache"
eternal="false"
timeToLiveSeconds="300"
timeToIdleSeconds="300"
overflowToDisk="true"
diskPersistent="false"
statistics="true"/>
<cache
name="org.hibernate.cache.spi.UpdateTimestampsCache"
maxElementsInMemory="10000"
maxElementsOnDisk="100000"
timeToLiveSeconds="300"
timeToIdleSeconds="300"
eternal="false"
overflowToDisk="true"
diskPersistent="false"
statistics="true"/>
<cache
name="query.Presences"
maxElementsInMemory="100"
maxElementsOnDisk="1000"
eternal="false"
timeToLiveSeconds="300"
timeToIdleSeconds="300"
overflowToDisk="true"
diskPersistent="false"
statistics="true"/>
<diskStore path="java.io.tmpdir/mywebapp-${project.version}_build_${buildNumber}"/>
</ehcache>
Run Code Online (Sandbox Code Playgroud)
${project.version} 和 ${buildNumber}
在构建过程中被maven取代.
有人知道如何避免这种不受欢迎的行为吗?
我使用的是ehcache-core-2.4.3和hibernate-ehcache-4.3.8.
我有以下代码段
<http use-expressions="true" auto-config="false"
entry-point-ref="loginUrlAuthenticationEntryPoint"
access-decision-manager-ref="accessDecisionManager" disable-url-rewriting="false">
<!--<custom-filter position="CONCURRENT_SESSION_FILTER" ref="concurrencyFilter"
/> -->
<custom-filter position="FORM_LOGIN_FILTER"
ref="usernamePasswordAuthenticationFilter" />
<custom-filter position="LOGOUT_FILTER" ref="tapLockFilter" />
<intercept-url pattern="/session/**" access="permitAll" />
<intercept-url pattern="/deviceregistration/**" access="permitAll" />
<intercept-url pattern="/session/lock" access="hasRole('ROLE_MEMBER')" />
<intercept-url pattern="/app/resources/admin*" access="hasRole('ROLE_ADMIN')" />
<intercept-url pattern="/app/SuperAppdashboard*" access="hasRole('ROLE_ADMIN')" />
<intercept-url pattern="/app/*" access="hasRole('ROLE_MEMBER')" />
<!--<session-management invalid-session-url="/tizelytics/session/invalidSession"
session-authentication-error-url="/tizelytics/session/accessDenied" session-authentication-strategy-ref="sas">
</session-management> -->
<session-management invalid-session-url="/session/invalidSession"
session-authentication-error-url="/session/accessDenied"
session-fixation-protection="none">
<concurrency-control max-sessions="1"
expired-url="/session/accessExpired" />
</session-management>
</http>
Run Code Online (Sandbox Code Playgroud)
当我在服务器上运行它时会抛出异常说
不支持的配置属性:[permitAll,permitAll,hasRole('ROLE_ADMIN'),hasRole('ROLE_ADMIN'),hasRole('ROLE_MEMBER'),hasRole('ROLE_MEMBER')]
这是我在同一个xml中的access-decision-manager bean
<beans:bean id="accessDecisionManager"
class="org.springframework.security.access.vote.AffirmativeBased">
<beans:constructor-arg>
<beans:list>
<beans:bean
class="org.springframework.security.access.vote.AuthenticatedVoter" />
<beans:bean class="org.springframework.security.access.vote.RoleVoter" />
</beans:list>
</beans:constructor-arg>
</beans:bean>
Run Code Online (Sandbox Code Playgroud)
如果我删除access-decision-manager-ref没有抛出任何异常,那么应用程序是否可以正常启动?
我最近更新了我的Eclipse IDE,并在CDT更新后出现了一个新的启动栏.
我真的不喜欢它,这就是我试图摆脱它的原因.我还没有找到隐藏或禁用它的方法......
你知道我怎么能这样做吗?
以下是启动栏的快照:https://wiki.eclipse.org/images/1/15/CDTLaunchBar.png
java ×4
jsp ×2
spring ×2
spring-mvc ×2
struts2 ×2
console ×1
deprecated ×1
eclipse ×1
eclipse-cdt ×1
ehcache ×1
enums ×1
hibernate ×1
ios ×1
ios8 ×1
maven ×1
ognl ×1
struts-1 ×1
struts-tags ×1
tomcat ×1
warnings ×1