[JBoss Seam] - <s:button> does not include Request parameter in 2.0.0 GA
by kchenga
i observed an interesting behavior with the <s:button> and request parameters just now.
in pages.xml
<page view-id="/hello.jsp" action="#{helloWorld.sayHello}">
in hello.jsp
this line of code,
<s:button view="/hello2.jsp" action="#{hellowWord2.sayAgain}"/>,
is translated to
<input onclick="location.href='/hello2.seam?firstName=&lastName=&cid=3&actionMethod=hello2.jsp%3AhellowWord2.sayAgain'" id="j_id2:j_id6" value="Say again" type="button" />
Notice the empty values for the firstName in lastName parameters in the onclick event even if the person object's corresponding attributes contain values.
this line of code without the view attribute in the button tag works -
<s:button action="#{hellowWord2.sayAgain}"/> to
<input onclick="location.href='/hello.seam?firstName=Mickey&lastName=Mouse&cid=3&actionMethod=hello.jsp%3AhellowWord2.sayAgain'" id="j_id2:j_id6" value="Say again" type="button" />
I'm using Seam 2.0.0 GA.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4125346#4125346
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4125346
17 years, 1 month
[Remoting] - problem wiht Identity object
by mazz@jboss.com
Suppose I have a box whose hostname is not resolvable via DNS (I know, I know, but for people demo'ing software on a laptop, we've seen it happen). So, I cannot "ping `hostname`" but I can "ping 127.0.0.1".
Look at NetworkRegistry:
public ObjectName preRegister(MBeanServer mBeanServer, ObjectName objectName) throws Exception
| {
| this.mBeanServer = mBeanServer;
| this.objectName = objectName;
| // make sure our identity system property is properly set
| Identity identity = Identity.get(this.mBeanServer);
| ...
|
Now look at the Identity.get() method it called there:
| if(identities.containsKey(server))
| {
| return (Identity) identities.get(server);
| }
| try
| {
| String serverid = (String) server.getAttribute(new ObjectName("JMImplementation:type=MBeanServerDelegate"), "MBeanServerId");
| Identity identity = new Identity(InetAddress.getLocalHost(), createId(server), serverid);
| identities.put(server, identity);
| return identity;
| }
It calls InetAddress.getLocalHost() but if that fails (and it will if the local hostname is not resolvable) you can *never* start a NetworkRegistry object.
If there is an exception here in that call to InetAddress.getLocalHost(), it should fallback and use: InetAddress getByName("127.0.0.1").
I tried setting "jboss.identity" sysprop to Identity.createUniqueID() but unfortunately, that sysprop isn't used in this class and NetworkRegistry never looks to see if that is set as a fallback.
I understand that without a resolvable host, it hobbles things - but for demo purposes of software that will ONLY ever run on a single laptop over the loopback network adapter on 127.0.0.1, this should still work without me having to disable things like the NetworkRegistry.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4125344#4125344
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4125344
17 years, 1 month
[JBoss Seam] - Re: Exception with basic authentication
by alllle
"shane.bryzak(a)jboss.com" wrote : The authentication should be triggered when calling/accessing a restricted Seam component, doing the chain.doFilter() call. It can't happen in the filter as not all contexts exist at that point in time.
My point might not be right as I am not as familiar to the framework as you do. However, I don't think your answer is correct.
chain.doFilter() will trigger the AuthenticationFilter logics to challenge the client for entering username / password. Once that information is entered, browser sends it to the server in the HTTP header. Seam then needs to invoke the #{authenticator.authenticate} method to perform the authentication in order to validate the username / password, which is defined in the components.xml file:
<security:identity authenticate-method="#{authenticator.authenticate}" />
The current logics only obtains the username / password, but does not invoke the authenticate method to actually validate this information. If you look at the
processDigestAuth() method of the AuthenticationFilter class, you will see it actually invokes the authenticate() method:
| private void authenticate(HttpServletRequest request, final String username)
| throws ServletException, IOException
| {
| new ContextualHttpServletRequest(request)
| {
| @Override
| public void process() throws ServletException, IOException, LoginException
| {
| Identity identity = Identity.instance();
| identity.setUsername(username);
| identity.authenticate();
| }
| }.run();
| }
|
As the code shows, this invocation is done in the ContextualHttpServletRequest environment, which creates necessary context objects. processBasicAuth() needs to do the same thing.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4125339#4125339
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4125339
17 years, 1 month