Re: shale-282 - character encoding problem with remoting/ajax

2006-12-15 Thread Torsten Krah
Any hints about this - using latest trunk and the problem is still
there  :(

Am Mittwoch, den 01.11.2006, 12:07 +0100 schrieb Torsten Krah:
> I am using german umlauts - the messages in the bundles are encoded in
> java unicode notation, works fine for all Message things.
> Now using remoting - its broken.
> With or without the patch, if i use "text/html" as content type and now
> the "ü" is encoded like "ü" it gets not printed, instead the
> "ü" is shown.
> 
> Used the ajax library the docs used too - some hints about the encoding
> problem?
> 
> Torsten


smime.p7s
Description: S/MIME cryptographic signature


Re: ViewController.prerender()

2006-12-15 Thread Torsten Krah
I don't get it working :-(. 

Although i removed the tiger annotations and trying to use the
faces-config.xml, prerender and preprocess aren't called, and even
sometimes destroy does not get called although init was called ( really
a break of contract as this should be called ).
So i've got a question about implementation details.

The prerender method and the others has to have to be registered as
phase listener, am i right?
So maybe someone can make some short details, at which shale "points" or
JSF ones i could look for if the listener is registered or not.
If it is done in some other way - i don't know in detail where to look
for at the moment - some hints would be nice, i'll really want to debug
this.

Torsten


Am Montag, den 20.11.2006, 14:11 -0800 schrieb Craig McClanahan:
> 
> * Download and d 


smime.p7s
Description: S/MIME cryptographic signature


Re: ViewController.prerender()

2006-12-15 Thread Gary VanMatre
>I don't get it working :-(. 
>
>Although i removed the tiger annotations and trying to use the
>faces-config.xml, prerender and preprocess aren't called, and even
>sometimes destroy does not get called although init was called ( really
>a break of contract as this should be called ).
>So i've got a question about implementation details.
>
>The prerender method and the others has to have to be registered as
>phase listener, am i right?
>So maybe someone can make some short details, at which shale "points" or
>JSF ones i could look for if the listener is registered or not.
>If it is done in some other way - i don't know in detail where to look
>for at the moment - some hints would be nice, i'll really want to debug
>this.
>

This view controller is an orchestration of several moving parts.   
It uses some new listeners available in servlet 2.4.  So, make sure 
your web container is 2.4 compliant.

http://svn.apache.org/viewvc/shale/framework/trunk/shale-view/src/main/java/org/apache/shale/view/faces/LifecycleListener.java?view=markup

The listeners are registered from a TLD within the META-INF folder of the 
shale-view.jar.

http://svn.apache.org/viewvc/shale/framework/trunk/shale-view/src/main/resources/META-INF/taglib.tld?view=markup


The init and destroy callback methods are invoked on a ViewController 
from events fired by the web container.  When request scoped objects 
are added or removed, the view controller callback methods are invoked 
if the object being acted on extends AbstractRequestBean or implements 
the ViewController interface.


These events are controlled by the servlet containers lifecycle as 
it handles request scoped beans.  The destroy is invoked when the container 
is cleaning up from handling the response lifecycle.  The init is 
invoked when the bean is added to request scope.  This is triggered 
by the managed bean container facility when a managed bean is needed.
The managed bean is instantiated by a custom view handler that adds to 
the decorated view handler.  This view handler is registered in the 
faces-config.xml along with the phase listener.


http://svn.apache.org/viewvc/shale/framework/trunk/shale-view/src/main/java/org/apache/shale/view/faces/ViewViewHandler.java?view=markup


The createView method of the view handler is overridden for the purpose 
of making sure the ViewController bean is instantiated by the managed 
bean facility.  The viewId is used to determine the name of the managed 
bean.  This is done by the DefaultViewControllerMapper that is also 
configurable (you can plug in your own implementation).


http://svn.apache.org/viewvc/shale/framework/trunk/shale-view/src/main/java/org/apache/shale/view/impl/DefaultViewControllerMapper.java?view=markup


The viewid to managed bean name mapping is determined and the bean is 
created using the application's variable resolver.  
If there is a managed bean registered by that name, it is instantiated 
and added to request scope.  This in turn fires the 
ServletRequestAttributeListener 
that we talked about above that invokes the init method on the ViewController.

 
The prerender and preproces methods on the ViewController are invoked 
from the JSF PhaseListener that is registered using the faces-config.xml 
within the META-INF directory of the shale-view.jar.


http://svn.apache.org/viewvc/shale/framework/trunk/shale-view/src/main/resources/META-INF/faces-config.xml?view=markup

So, there are several faces and servlet extensions that are utilized 
to add the additional view controller events.


>Torsten

Gary--- Begin Message ---
I don't get it working :-(. 

Although i removed the tiger annotations and trying to use the
faces-config.xml, prerender and preprocess aren't called, and even
sometimes destroy does not get called although init was called ( really
a break of contract as this should be called ).
So i've got a question about implementation details.

The prerender method and the others has to have to be registered as
phase listener, am i right?
So maybe someone can make some short details, at which shale "points" or
JSF ones i could look for if the listener is registered or not.
If it is done in some other way - i don't know in detail where to look
for at the moment - some hints would be nice, i'll really want to debug
this.

Torsten


Am Montag, den 20.11.2006, 14:11 -0800 schrieb Craig McClanahan:
> 
> * Download and d 


smime.p7s
Description: S/MIME cryptographic signature
--- End Message ---


Re: ViewController.prerender()

2006-12-15 Thread Torsten Krah
Thx for help.
I got the point why prerender is not called - looking at the
phaselistener there is following code in the beforeRenderResponse()
method:

...
Map map =
event.getFacesContext().getExternalContext().getRequestMap();
String viewName = (String)
map.get(FacesConstants.VIEW_NAME_RENDERED);
if (viewName == null) {
return;
}
...


And sadly after debugging things, viewName is null when the condition i
evaluated and the method returns immediately and the prerender code
never gets called.

So my questions is - why is the viewName null, any ideas? 

Torsten


smime.p7s
Description: S/MIME cryptographic signature


Re: ViewController.prerender()

2006-12-15 Thread Torsten Krah
Addition:

Looking at the ViewViewHandler.java, it fails at line 299.
method: setupViewController:

the viewName gets a value, the vr instance too, but:

vc = vr.resolveVariable(context, viewName);

return null and the method returns.

Now the interesting question, if context is valid and a viewname is
there - why would the vr fail to resolve the variable?

Torsten

Am Freitag, den 15.12.2006, 18:03 +0100 schrieb Torsten Krah:
> Thx for help.
> I got the point why prerender is not called - looking at the
> phaselistener there is following code in the beforeRenderResponse()
> method:
> 
> ...
> Map map =
> event.getFacesContext().getExternalContext().getRequestMap();
> String viewName = (String)
> map.get(FacesConstants.VIEW_NAME_RENDERED);
> if (viewName == null) {
> return;
> }
> ...
> 
> 
> And sadly after debugging things, viewName is null when the condition i
> evaluated and the method returns immediately and the prerender code
> never gets called.
> 
> So my questions is - why is the viewName null, any ideas? 
> 
> Torsten


smime.p7s
Description: S/MIME cryptographic signature


Re: ViewController.prerender()

2006-12-15 Thread Gary VanMatre
>Thx for help.
>I got the point why prerender is not called - looking at the
>phaselistener there is following code in the beforeRenderResponse()
>method:
>
>...
>Map map =
>event.getFacesContext().getExternalContext().getRequestMap();
>String viewName = (String)
>map.get(FacesConstants.VIEW_NAME_RENDERED);
>if (viewName == null) {
>return;
>}
>...
>
>
>And sadly after debugging things, viewName is null when the condition i
>evaluated and the method returns immediately and the prerender code
>never gets called.
>
>So my questions is - why is the viewName null, any ideas? 
>

That is odd.  What is your viewId?  If the ViewController cannot find a managed 
bean
registered that maps to the view id, the viewName will be null.

The default view mapper will replace the "/" with "$" and remove the suffix.  
If your 
viewId is "/pages/myview.faces", you need a managed bean registred in the faces 
config
with a managed-bean-name of "pages$myview".

Are you by chance using the Shale Remoting here or is this just a normal JSF 
page?



>Torsten


Gary--- Begin Message ---
Thx for help.
I got the point why prerender is not called - looking at the
phaselistener there is following code in the beforeRenderResponse()
method:

...
Map map =
event.getFacesContext().getExternalContext().getRequestMap();
String viewName = (String)
map.get(FacesConstants.VIEW_NAME_RENDERED);
if (viewName == null) {
return;
}
...


And sadly after debugging things, viewName is null when the condition i
evaluated and the method returns immediately and the prerender code
never gets called.

So my questions is - why is the viewName null, any ideas? 

Torsten


smime.p7s
Description: S/MIME cryptographic signature
--- End Message ---


Re: ViewController.prerender()

2006-12-15 Thread Torsten Krah
Should have read the documentation again *shame on me" - read it once in
early stage, but doc is changing of cause and i have missed the
dependency of the default mapping controller naming scheme and my beans
are not named to comply the default mapping, after changing that it
works.

My fault, sorry, - works now :-(

Torsten


Am Freitag, den 15.12.2006, 18:09 + schrieb Gary VanMatre:
> >Thx for help.
> >I got the point why prerender is not called - looking at the
> >phaselistener there is following code in the beforeRenderResponse()
> >method:
> >
> >...
> >Map map =
> >event.getFacesContext().getExternalContext().getRequestMap();
> >String viewName = (String)
> >map.get(FacesConstants.VIEW_NAME_RENDERED);
> >if (viewName == null) {
> >return;
> >}
> >...
> >
> >
> >And sadly after debugging things, viewName is null when the condition
> i
> >evaluated and the method returns immediately and the prerender code
> >never gets called.
> >
> >So my questions is - why is the viewName null, any ideas? 
> >
>  
> That is odd.  What is your viewId?  If the ViewController cannot find
> a managed bean
> registered that maps to the view id, the viewName will be null.
>  
> The default view mapper will replace the "/" with "$" and remove the
> suffix.  If your 
> viewId is "/pages/myview.faces", you need a managed bean registred in
> the faces config
> with a managed-bean-name of "pages$myview".
>  
> Are you by chance using the Shale Remoting here or is this just a
> normal JSF page?
>  
>  
> 
> >Torsten
>  
>  
> Gary
> 
> E-Mail-Nachricht-Anlage
> >  Weitergeleitete Nachricht 
> > Von: Torsten Krah <[EMAIL PROTECTED]>
> > An: user@shale.apache.org
> > Betreff: Re: ViewController.prerender()
> > Datum: Fri, 15 Dec 2006 17:03:58 +
> > 
> > Thx for help.
> > I got the point why prerender is not called - looking at the
> > phaselistener there is following code in the beforeRenderResponse()
> > method:
> > 
> > ...
> > Map map =
> > event.getFacesContext().getExternalContext().getRequestMap();
> > String viewName = (String)
> > map.get(FacesConstants.VIEW_NAME_RENDERED);
> > if (viewName == null) {
> > return;
> > }
> > ...
> > 
> > 
> > And sadly after debugging things, viewName is null when the condition i
> > evaluated and the method returns immediately and the prerender code
> > never gets called.
> > 
> > So my questions is - why is the viewName null, any ideas? 
> > 
> > Torsten


smime.p7s
Description: S/MIME cryptographic signature


Re: ViewController.prerender()

2006-12-15 Thread Gary VanMatre

>Should have read the documentation again *shame on me" - read it once in
>early stage, but doc is changing of cause and i have missed the
>dependency of the default mapping controller naming scheme and my beans
>are not named to comply the default mapping, after changing that it
>works.
>
>My fault, sorry, - works now :-(

Cool.  Rock on!

>
>Torsten

Gary--- Begin Message ---
Should have read the documentation again *shame on me" - read it once in
early stage, but doc is changing of cause and i have missed the
dependency of the default mapping controller naming scheme and my beans
are not named to comply the default mapping, after changing that it
works.

My fault, sorry, - works now :-(

Torsten


Am Freitag, den 15.12.2006, 18:09 + schrieb Gary VanMatre:
> >Thx for help.
> >I got the point why prerender is not called - looking at the
> >phaselistener there is following code in the beforeRenderResponse()
> >method:
> >
> >...
> >Map map =
> >event.getFacesContext().getExternalContext().getRequestMap();
> >String viewName = (String)
> >map.get(FacesConstants.VIEW_NAME_RENDERED);
> >if (viewName == null) {
> >return;
> >}
> >...
> >
> >
> >And sadly after debugging things, viewName is null when the condition
> i
> >evaluated and the method returns immediately and the prerender code
> >never gets called.
> >
> >So my questions is - why is the viewName null, any ideas? 
> >
>  
> That is odd.  What is your viewId?  If the ViewController cannot find
> a managed bean
> registered that maps to the view id, the viewName will be null.
>  
> The default view mapper will replace the "/" with "$" and remove the
> suffix.  If your 
> viewId is "/pages/myview.faces", you need a managed bean registred in
> the faces config
> with a managed-bean-name of "pages$myview".
>  
> Are you by chance using the Shale Remoting here or is this just a
> normal JSF page?
>  
>  
> 
> >Torsten
>  
>  
> Gary
> 
> E-Mail-Nachricht-Anlage
> >  Weitergeleitete Nachricht 
> > Von: Torsten Krah <[EMAIL PROTECTED]>
> > An: user@shale.apache.org
> > Betreff: Re: ViewController.prerender()
> > Datum: Fri, 15 Dec 2006 17:03:58 +
> > 
> > Thx for help.
> > I got the point why prerender is not called - looking at the
> > phaselistener there is following code in the beforeRenderResponse()
> > method:
> > 
> > ...
> > Map map =
> > event.getFacesContext().getExternalContext().getRequestMap();
> > String viewName = (String)
> > map.get(FacesConstants.VIEW_NAME_RENDERED);
> > if (viewName == null) {
> > return;
> > }
> > ...
> > 
> > 
> > And sadly after debugging things, viewName is null when the condition i
> > evaluated and the method returns immediately and the prerender code
> > never gets called.
> > 
> > So my questions is - why is the viewName null, any ideas? 
> > 
> > Torsten


smime.p7s
Description: S/MIME cryptographic signature
--- End Message ---