[JBoss Seam] - Parameters in EL method binding
by jbeaken
Using facelets, jboss 1.2.1GA, jboss4.2.1, ajax4jsf
>From the seam docs:
Seam provides an enhancement to the EL that allows parameters to be included in a method expression itself. This applies to any Seam method expression, including any JSF method binding, for example:
<s:commandButton action="#{hotelBooking.bookHotel(hotel)}" value="Book Hotel"/>
To use this feature in Facelets, you will need to declare a special view handler, SeamFaceletViewHandler in faces-config.xml.
<faces-config>
<view-handler>org.jboss.seam.ui.facelet.SeamFaceletViewHandler</view-handler>
</faces-config>
but as I'm using AJAX4JSF this declaration is moved to web.xml
<context-param>
<param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
<param-value>
org.jboss.seam.ui.facelet.SeamFaceletViewHandler
</param-value>
</context-param>
But in my xhtml (using faclets), if I even hint at using parameters such as :
<f:selectItems value="#{roleSelectItemListService.allRoles()}"/>
it throws
Caused by: javax.el.ELException: Error Parsing: #{roleSelectItemListService.allRoles()}
at org.apache.el.lang.ExpressionBuilder.createNodeInternal(ExpressionBuilder.java:125)
at org.apache.el.lang.ExpressionBuilder.build(ExpressionBuilder.java:146)
at org.apache.el.lang.ExpressionBuilder.createValueExpression(ExpressionBuilder.java:190)
at org.apache.el.ExpressionFactoryImpl.createValueExpression(ExpressionFactoryImpl.java:68)
at org.jboss.seam.ui.facelet.SeamExpressionFactory.createValueExpression(SeamExpressionFactory.java:107)
at com.sun.facelets.tag.TagAttribute.getValueExpression(TagAttribute.java:256)
... 75 more
Caused by: org.apache.el.parser.ParseException: Encountered "(" at line 1, column 37.
If I use
<f:selectItems value="#{roleSelectItemListService.allRoles}"/>
it works fine,
has anybody else come across this
thanks in advance
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4083524#4083524
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4083524
18 years, 8 months
[Beginners Corner] - Re: Cannot View Tomcat From External URL ?
by woollybarr
Hope I get in here quick before anyone slams me for not reading the notes:
======================================
Configuration Issues
This lists the changes that could affect configuration.
* JBossAS now binds its services to localhost (127.0.0.1) *by default*, instead of binding to all available interfaces (0.0.0.0). This was primarily done for security reasons because of concerns of users going to production without having secured their servers properly. To enable remote access by binding JBoss services to a particular interface, simply run jboss with the -b option, but be aware you still need to secure you server properly.
======================================
So now i run with:
run -b0.0.0.0
...instead of just double clicking run.bat
And of course I'll worry about security at some point too.....
Cheers,
Phil
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4083523#4083523
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4083523
18 years, 8 months
[JBoss Tools (users)] - Packaging configuration and building in Beta3?
by tachoknight
Aloha-
I have Beta2 installed on an Eclipse 3.2 and have been using it to build servlets using the packaging feature. I create a standard Java project, go to properties, choose "Packaging Configuration" and enable it, set it up, etc. Then, when I want to build the WAR file I right-click on the project and select "Run Packaging". Voila! I have a WAR file.
I installed Beta3 on a new instance of Eclipse Europa as that's the latest version of both, and suddenly all mention of packaging is gone. Gone from the properties, gone from the context menu, everywhere.
I can't seem to find the beta3 release notes to indicate what happened to it, so does anyone know where I can find this functionality? I can't imagine they'd remove this feature.
Thanks,
Ron
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4083517#4083517
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4083517
18 years, 8 months
[Installation, Configuration & DEPLOYMENT] - Re: setup jboss as server on LAN
by PeterJ
Yes, you can do this. I do it quite often.
When you deploy an application, first copy (or ftp) it to a temporary directory on the JBoss host system, and then move the application to the deploy directory. If you try to ftp or copy to the deploy directory directly, the hot deployer might attempt to deploy the application before the copy is complete, resulting in zip file errors.
I do not know how, or if, you can hook up JBoss AS with Eclipse in this scenario. What I usually do is have my Ant or Maven script do the deploy, and I manually start and stop the app server. Also, I do not know if you can debug apps via Eclipse in this scenario.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4083515#4083515
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4083515
18 years, 8 months
[JBoss Seam] - Re: Problem running integration test
by nayanj
WEB-INF\components.xml specifies following:
| <security:identity authenticate-method="#{authenticator.authenticate}"/>
|
| @Name("authenticator")
| public class AuthenticatorAction {
|
| @Out(required = false, scope = SESSION)
| private User user;
|
| public boolean authenticate() {
| // does authentication here
| if( authentication successful ){
| user = new User();
| user.setGivenName("Given");
| user.setLastName("Last");
| return true;
| }
| return false;
| }
| }
|
User.java
| @Name("user")
| @Scope(SESSION)
| public class User implements Serializable {
|
| private String username;
|
| private String password;
|
| private String lastName;
|
| private String givenName;
|
| // followed by get and set methods for all the instance variables
| }
|
build.xml snippet to run test
| <property name="test.src" location="testsrc"/>
| <path id="testng.classpath">
| <fileset dir="${lib}/mc" includes="*.jar"/>
| <fileset dir="${lib}" includes="*.jar" excludes="commons-el-1.0.jar"/>
| <pathelement location="${build.home}/classes" />
| <pathelement location="${webinf}/classes" />
| <pathelement location="${webinf}"/>
| </path>
|
| <taskdef name="testng" classpathref="testng.classpath" classname="org.testng.TestNGAntTask" />
|
| <target name="tests.compile" depends="compile">
| <mkdir dir="${build.home}/test/classes"/>
| <javac destdir="${build.home}/classes" classpathref="testng.classpath" debug="true">
| <src path="${test.src}" />
| </javac>
| </target>
|
| <target name="test" depends="tests.compile">
| <delete dir="test-output" />
| <testng classpathref="testng.classpath" outputdir="test-output">
| <xmlfileset dir="${test.src}" includes="**/security/test/testng.xml" />
| </testng>
| </target>
|
complete error log:
| [testng] 10:06:29,969 ERROR [SeamLoginModule] Error invoking login method
| [testng] java.lang.NullPointerException
| [testng] at org.jboss.seam.security.jaas.SeamLoginModule.login(SeamLoginModule.java:104)
| [testng] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| [testng] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
| [testng] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
| [testng] at java.lang.reflect.Method.invoke(Unknown Source)
| [testng] at javax.security.auth.login.LoginContext.invoke(Unknown Source)
| [testng] at javax.security.auth.login.LoginContext.access$000(Unknown Source)
| [testng] at javax.security.auth.login.LoginContext$5.run(Unknown Source)
| [testng] at java.security.AccessController.doPrivileged(Native Method)
| [testng] at javax.security.auth.login.LoginContext.invokeCreatorPriv(Unknown Source)
| [testng] at javax.security.auth.login.LoginContext.login(Unknown Source)
| [testng] at org.jboss.seam.security.Identity.authenticate(Identity.java:247)
| [testng] at org.jboss.seam.security.Identity.authenticate(Identity.java:240)
| [testng] at org.jboss.seam.security.Identity.login(Identity.java:170)
| [testng] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| [testng] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
| [testng] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
| [testng] at java.lang.reflect.Method.invoke(Unknown Source)
| [testng] at com.sun.el.parser.AstValue.invoke(AstValue.java:174)
| [testng] at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:286)
| [testng] at org.jboss.seam.util.UnifiedELMethodBinding.invoke(UnifiedELMethodBinding.java:36)
| [testng] at org.jboss.seam.actionparam.ActionParamBindingHelper.invokeTheExpression(ActionParamBindingHelper.java:58)
| [testng] at org.jboss.seam.actionparam.ActionParamMethodBinding.invoke(ActionParamMethodBinding.java:75)
| [testng] at org.jboss.seam.actionparam.ActionParamBindingHelper.invokeTheExpression(ActionParamBindingHelper.java:58)
| [testng] at org.jboss.seam.actionparam.ActionParamMethodBinding.invoke(ActionParamMethodBinding.java:75)
| [testng] at org.jboss.seam.mock.SeamTest$Request.invokeMethod(SeamTest.java:401)
| [testng] at security.test.LoginTest$2.invokeApplication(LoginTest.java:38)
| [testng] at org.jboss.seam.mock.SeamTest$Request.run(SeamTest.java:489)
| [testng] at security.test.LoginTest.testSuccessfulLogin(LoginTest.java:52)
| [testng] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| [testng] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
| [testng] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
| [testng] at java.lang.reflect.Method.invoke(Unknown Source)
| [testng] at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:604)
| [testng] at org.testng.internal.Invoker.invokeMethod(Invoker.java:470)
| [testng] at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:564)
| [testng] at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:830)
| [testng] at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
| [testng] at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
| [testng] at org.testng.TestRunner.runWorkers(TestRunner.java:678)
| [testng] at org.testng.TestRunner.privateRun(TestRunner.java:624)
| [testng] at org.testng.TestRunner.run(TestRunner.java:495)
| [testng] at org.testng.SuiteRunner.runTest(SuiteRunner.java:300)
| [testng] at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:295)
| [testng] at org.testng.SuiteRunner.privateRun(SuiteRunner.java:275)
| [testng] at org.testng.SuiteRunner.run(SuiteRunner.java:190)
| [testng] at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:792)
| [testng] at org.testng.TestNG.runSuitesLocally(TestNG.java:765)
| [testng] at org.testng.TestNG.run(TestNG.java:699)
| [testng] at org.testng.TestNG.privateMain(TestNG.java:824)
| [testng] at org.testng.TestNG.main(TestNG.java:802)
| [testng] FAILED: testSuccessfulLogin
| [testng] javax.el.PropertyNotFoundException: ELResolver cannot handle a null base Object with identifier 'user'
| [testng] at com.sun.el.lang.ELSupport.throwUnhandled(ELSupport.java:52)
| [testng] at com.sun.el.parser.AstIdentifier.getValue(AstIdentifier.java:75)
| [testng] at com.sun.el.parser.AstValue.getValue(AstValue.java:114)
| [testng] at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:195)
| [testng] at org.jboss.seam.util.UnifiedELValueBinding.getValue(UnifiedELValueBinding.java:34)
| [testng] at org.jboss.seam.mock.SeamTest$Request.getValue(SeamTest.java:366)
| [testng] at security.test.LoginTest$2.renderResponse(LoginTest.java:46)
| [testng] at org.jboss.seam.mock.SeamTest$Request.run(SeamTest.java:521)
| [testng] at security.test.LoginTest.testSuccessfulLogin(LoginTest.java:52)
| [testng] ... Removed 22 stack frames
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4083511#4083511
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4083511
18 years, 8 months