java-ee

Sending text-field value to server without form tag

三世轮回 提交于 2019-12-23 04:34:32
问题 I need to post a text-field value to server but i have not placed the text-field in side the form tag.Here is the details of my use-case i have an anchor tag like <a href="${request.contextPath}/login" class="login">LOGIN</a> This anchor tag is not inside any form tag and i need to send one extra value to the server and don't want that value to append as query string. I have created a hidden filed and have provided the required value to that hidden field, but when i click on the Login link

JBoss JMS provider

笑着哭i 提交于 2019-12-23 04:28:35
问题 I need to write a Message Driven Bean. I'm using JBoss IDE 1.5. I understand the concept behind MDB's but I don't really know how to install the JMS provider (JBoss MQ? I think) and use it so that it will be used to broker my message to an MDB. does anyone know of a tutorial I can use ? 回答1: JBossMQ is the default JMS provider in JBoss 3.2.x and 4.x but is replaced by JBoss Messaging 1 in JBoss AS 5.0 (JBoss Messaging 1.x is the default JMS provider in JBoss AS version 5). Depending on the

Perform validation on domain model

大兔子大兔子 提交于 2019-12-23 04:14:20
问题 Our business domain model has complex validation rules, which can only be executed when the model has been updated. Something like this: public classs MyDomainModel { public DomainValidationContext getValidationContext() { ... } } We don't want to extract these, since: it would mean duplication of the validation rules. List item some rules are only "soft-rules" which should result in warning messages without stopping further processing. We considered duplicating the DomainModel in the

Can I use hibernate entity annotations with bean validation

痴心易碎 提交于 2019-12-23 04:11:32
问题 To use bean validation for form fields in JSF 2, you can use annotations in the bean like @Length(max=5) . However, since these constraints are already defined in my Hibernate entity object, for example: @Column(name = "FIELDX", length = 5) , I was wondering if there's a way to use them for the validation? 回答1: No, you can't. And you shouldn't, because: validation logic might change while field definition is retained only a few of the constraints can be mapped to column definitions 来源: https:

Struts 2 - Select default value

孤者浪人 提交于 2019-12-23 04:09:04
问题 I had two select like this : <s:select label = "Pays " list="payss" key="pays" value="%{FRANCE}"></s:select> <s:select label = "Categorie " list="categories" key="categorie" value="%{200}">/s:select> The second default value works but the first is not, the lists are like this : payss : FRANCE BELGIQUE categories : 200 300 回答1: Try value="%{'FRANCE'}" OGNL is looking for the variable FRANCE and couldn't find it, because you didn't use it in the valueStack . 来源: https://stackoverflow.com

Download Java EE API JARs as OSGI bundles

强颜欢笑 提交于 2019-12-23 04:05:16
问题 Is there a place where I can download Java EE API JARs as OSGi bundles? 回答1: I don't know of anywhere where you can do that, but you can wrap the jars and deploy them as bundles with the wrap scheme. So the command that you would want to use to pull them from maven and wrap them as bundles would be osgi:install -s wrap:mvn:javax/javaee-api/6.0 . 回答2: Apache Geronimo produces API jars for the Java EE packages and they are all (at least all the ones I've used) OSGi bundles. They are all

Google App Engine/Jetty: Introspection Fails for Dynamic Proxy?

别来无恙 提交于 2019-12-23 03:47:13
问题 Why does Introspector not correctly discover the properties of a dynamic proxy class in Jetty/GAE? I ran into this curious problem while trying to use a dynamic proxy with Java EL/JSPs when deploying locally on GAE with Jetty. You can see the original question here. Anyways, I have since simplified the code and narrowed down the problem. Here is the new code: MyServlet.java : package test; // imports omitted public class MyServlet extends HttpServlet { public interface MyInterface { public

How to get details of MessageReceivers of JMS Queue(HornetQ deployed in JBoss AS6)?

為{幸葍}努か 提交于 2019-12-23 03:45:31
问题 I need to get details of Message Receivers which are connected to JMS Queue, I am using HornetQ which is deployed in JBoss AS6. Is there such operation/API already defined in JMX/JMS? Any other approach to get details of MessageReceivers? I need to know number of MessageReceivers & their IP Address. Any suggestion is appreciated. Thanks. 回答1: There are method on the management with hornetQ 2.2.2+. Things like connectionID are exposed as meta-datas. 来源: https://stackoverflow.com/questions

Java .policy file - how to prevent java.util.Date() from being accessible

白昼怎懂夜的黑 提交于 2019-12-23 03:43:10
问题 I am playing around with the java .policy file and was wondering how I could go about doing something like preventing calls to java.util.Date(), as an example. I just want to get a better sense of the .policy file works and how it can be used to sandbox code. 回答1: You'll be out of luck there I'm afraid. As Paŭlo Ebermann says, package.access can block out package hierarchies. You can be more precise about this with a custom SecurityManager , which is usually a damn good indication you are

Spring Transactional annotation, isolation not working for READ_UNCOMMITTED

人盡茶涼 提交于 2019-12-23 03:29:32
问题 I have a method in Java which is wrapped by a spring Transactional annotation. I have 2 operations inside, one is delete , another one is insert . My insertion statement have to rely on the first operation (which is the delete ), but now because of the first operation is not committed yet, my insertion fail (unique constraint). But this is funny that, usually within the same transaction, I should be able to read/see the uncommited operation in the same transaction (my old proprietary