[JBoss Seam] - Re: captcha
by spambob
"christian.bauer(a)jboss.com" wrote : Yep, the JCaptcha default engine needs a graphics display buffer. This is not good and won't run on servers without displays. In fact, I think integrating JCaptcha wasn't the best idea we ever had, it's slow, has unusable default output (I really can't read it), and has dependencies such as this.
|
| Alternatives welcome...
|
The only other captcha engine for java I know of is "the simple java captcha" (http://simplecaptcha.sourceforge.net/). I have no idea if it is faster than JCaptcha or if it needs a running X server too but at least the output seems more readable (I couldn't read JCaptcha output if my life would depend on it).
However: an alternative to captchas could be asking simple math questions (like they do at jroller). Together with a tag that translates the numbers and the operand into iso & hex - e.g. 1+2 would be: 1+2 - this should be as save, cheaper to compute and much easier for users than barely readable captchas.
Last but not least this "translator" tag could be used to obfuscate email addresses so they can be safely displayed and don't get harvested by spammers which seems to be a quite valuable addition to me ;). Please have a look at http://www.seowebsitepromotion.com/obfuscate_email.asp for a more detailed explanation!
So what do you think about this?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4036319#4036319
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4036319
19 years
[JBoss Seam] - Page parameters - change value
by cdanielw
There is probably something I got wrong - but here is my case:
| <?xml version='1.0' encoding='UTF-8'?>
| <html xmlns="http://www.w3.org/1999/xhtml"
| xmlns:h="http://java.sun.com/jsf/html">
| <head></head>
| <body>
| <h:form>
| #{test}
| </h:form>
| </body>
| </html>
|
and a page parameter mapping
| <page view-id="/test.xhtml">
| <param name="testValue" value="#{test}"/>
| </page>
|
Requsting the page /test.jsf?testValue=123 outputs 123
However, if requesting /test.jsf?testValue=456 afterwards
123 is still displayed.
Note that this only happens if including the form on the page.
I was planning of using the page parameter to make my pages bookmarkable, but it seems to be trickier then I though. There must me something obvious that I'm missing?
My workaround for now has been to extend SeamPhaseListener and make sure Pages.instance().applyRequestParameterValues(facesContext) is always executed in the afterRestoreView() function. This feels a bit scary, since I'm not that familiar with the inner workings of this stuff.
Any suggestions?
I'm running Seam 1.2.1.GA, Facelets 1.1.11 and MyFaces 1.1.6 nighly build from March.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4036317#4036317
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4036317
19 years
[EJB 3.0] - java.lang.ClassCastException when listing objects
by valjjou
Hello all,
I manage to insert an object with my bean entity but fail when trying to
list all objects. The following exception occurs:
javax.ejb.EJBException: java.lang.ClassCastException: org.hibernate.hql.ast.HqlToken
| org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:69)
| org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83)
| org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:191)
| org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
| org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
| org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
| org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:102)
| org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)
| org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
| org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:211)
| org.jboss.ejb3.stateless.StatelessLocalProxy.invoke(StatelessLocalProxy.java:79)
| $Proxy98.listContact(Unknown Source)
| servlet.ListContactServlet.doGet(ListContactServlet.java:23)
| javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
| javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
| org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
my bean entity :
@Stateless
| @Local(value = { ContactManager.class })
| public class ContactManagerBean implements ContactManager {
| @PersistenceContext(unitName = "contactUnit")
| protected EntityManager em;
|
| public Contact addContact(Contact contact) {
| em.persist(contact);
| return contact; }
|
| public ArrayList<Contact> listContact() {
| return (ArrayList<Contact>)em.createQuery("select contact from contact as contact").getResultList(); }
| }
Can anyone help me?
Thanks for helping,
Cheers.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4036312#4036312
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4036312
19 years
[JBossWS] - Maven2, XDoclet and JBossWS (no webservices shown)
by Schludi
Hello I have a question. I only want to deploy an EJB written in XDoclet (i know about annotations, but need to publish webservices of an existing project written with XDoclet) which is displayed under http://localhost:8080/jbossws/services
I am using Maven2 and XDoclet.
I will post the POM.XML of the EJB-Project an the EJB's Java-Code.
First the EJB-Code with XDoclet:
| package com.bbraun.bbmag.test;
|
| import java.rmi.RemoteException;
|
| import java.math.*;
| import javax.ejb.SessionBean;
| import javax.ejb.SessionContext;
| import java.math.*;
|
| /**
| * Trade Session EJB manages all Trading services
| *
| * @ejb.bean name="FirstEJBBean"
| * display-name="FirstEJBBean"
| * description="A simple hello world bean."
| * jndi-name="FirstEJBBean"
| * type=stateless
| * view-type="service-endpoint"
| *
| * @ejb.interface
| * service-endpoint-class="com.bbraun.bbmag.test.StatlessEJBEndpoint"
| *
| * @wsee.port-component
| * name="StatlessEJBEndpointPort"
| */
| public class StatlessEjbBean implements SessionBean
| {
|
| BigDecimal yenRate = new BigDecimal("121.6000");
|
| BigDecimal euroRate = new BigDecimal("0.0077");
|
| /**
| * @ejb.interface-method view-type="service-endpoint"
| */
| public BigDecimal dollarToYen(BigDecimal dollars) {
| BigDecimal result = dollars.multiply(yenRate);
| return result.setScale(2, BigDecimal.ROUND_UP);
| }
|
| /**
| * @ejb.interface-method view-type="service-endpoint"
| */
| public BigDecimal yenToEuro(BigDecimal yen) {
| BigDecimal result = yen.multiply(euroRate);
| return result.setScale(2, BigDecimal.ROUND_UP);
| }
|
| public StatlessEjbBean() {
| }
|
| public void ejbCreate() {
| }
|
| public void ejbRemove() {
| }
|
| public void ejbActivate() {
| }
|
| public void ejbPassivate() {
| }
|
| public void setSessionContext(SessionContext sc) {
| }
| }
|
Here is the POM.XML of the EJB-Project:
| <project>
| <modelVersion>4.0.0</modelVersion>
| <parent>
| <groupId>com.bbraun.bbmag.test</groupId>
| <artifactId>FirstEJB</artifactId>
| <version>0.1</version>
| </parent>
| <artifactId>FirstEJB-ejb</artifactId>
| <packaging>ejb</packaging>
| <name>FirstEJBejb</name>
| <description>Eine EJB</description>
|
|
| <dependencies>
| <dependency>
| <groupId>org.apache.geronimo.specs</groupId>
| <artifactId>geronimo-j2ee_1.4_spec</artifactId>
| <version>1.0</version>
| <scope>provided</scope>
| </dependency>
| <dependency>
| <groupId>commons-logging</groupId>
| <artifactId>commons-logging</artifactId>
| <version>1.0.3</version>
| <scope>provided</scope>
| </dependency>
| <dependency>
| <groupId>axis</groupId>
| <artifactId>axis</artifactId>
| <version>1.2</version>
| <scope>provided</scope>
| </dependency>
| <dependency>
| <groupId>axis</groupId>
| <artifactId>axis-jaxrpc</artifactId>
| <version>1.2</version>
| <scope>provided</scope>
| </dependency>
| </dependencies>
| <build>
| <testSourceDirectory>src/test</testSourceDirectory>
| <plugins>
| <plugin>
| <groupId>org.codehaus.mojo</groupId>
| <artifactId>xdoclet-maven-plugin</artifactId>
| <executions>
| <execution>
| <id>ejb</id>
| <phase>generate-sources</phase>
| <goals>
| <goal>xdoclet</goal>
| </goals>
| <configuration>
| <tasks>
| <ejbdoclet
| verbose="true"
| force="true"
| ejbSpec="2.1"
| destDir="${project.build.directory}/generated-sources/xdoclet">
| <fileset
| dir="${project.build.sourceDirectory}">
| <include name="**/*Bean.java"></include>
| <include name="**/*MDB.java"></include>
| </fileset>
| <homeinterface />
| <remoteinterface />
| <localhomeinterface />
| <localinterface />
| <service-endpoint/>
| <utilobject localProxies="true"/>
| <deploymentdescriptor destDir="${project.build.outputDirectory}/META-INF"/>
| </ejbdoclet>
| </tasks>
| </configuration>
| </execution>
| </executions>
| </plugin>
| <plugin>
| <groupId>org.apache.maven.plugins</groupId>
| <artifactId>maven-ejb-plugin</artifactId>
| <configuration>
| <generateClient>true</generateClient>
| <clientExcludes>
| <clientExclude>
| **/ejb/*Bean.class
| </clientExclude>
| </clientExcludes>
| </configuration>
| </plugin>
| </plugins>
| </build>
| </project>
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4036310#4036310
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4036310
19 years