[Tomahawk] icon and label in NavigationMenuItem

2007-05-15 Thread DZISIAK Jean-Paul
Hello,

It seems that a NavigationMenuItem is unable to display both a label *and* an 
icon. It can however display only one of them. 

Moreover when an icon is displayed a 1px border is displayed. Id'd like to get 
rid of it. How can this be achieved ?

NavigationMenuItem item = new NavigationMenuItem(label, action);
item.setValue();
item.setIcon();

Thanks for your help

Jean-paul DZISIAK






Re: h:graphicImage and Servlets

2007-05-15 Thread Martin Marinschek

ok, yes, that's clear - you can't embed an attachment.

For other files - there is a typo in your code - attachment instead of
attachment would be appropriate.

response.setHeader("Content-Disposition", "attachment; filename=\"" +
  file.getFileName() + "\"");

regards,

Martin

On 5/16/07, omidh <[EMAIL PROTECTED]> wrote:


Hi Martin,
thank you for your response,

the class name is correct.
I solved it with my FileServlet now.
The problem in the servlet was (I think) that when showing Image
it may not be set the response.setHeader(...), now the code look like these

To whom it may interest:

protected void doGet(HttpServletRequest request,
HttpServletResponse response) throws ServletException, 
IOException {

FacesContext fctx = getFacesContext(request, response);

ValueBinding bind = 
FacesContext.getCurrentInstance().getApplication()
.createValueBinding("#{facadeService}");

FacadeService bean = (FacadeService) bind.getValue(fctx);

if (logger.isDebugEnabled())
logger.debug("Bean=" + bean);

OutputStream out = response.getOutputStream();

Integer fileId = 
Integer.parseInt(request.getParameter("file_id"));

UFile file =
(UFile)bean.getMileStoneService().getEntryManager().loadById(UFile.class,
fileId);
logger.debug("file="+file);
if(file != null){
response.setContentType(file.getContentType());
response.setContentLength(file.getContent().length);
if(file.getContentType().indexOf("image") == -1){
response.setHeader("Content-Disposition", "attachement; 
filename=\"" +
file.getFileName() + "\"");
}
if(logger.isDebugEnabled())
logger.debug("sending file ...");
out.write(file.getContent());
out.flush();
out.close();
response.flushBuffer();
}

as you can see the changes are minimal...
don't forget to add the following to the web.xml:


FileServlet
File servlet
Servlet used to view or download an Image or
document

main.org.jboss.portlet.milestone.servlet.FileServlet



FileServlet
/FileServlet/*


and the call for me from a jsp:



so again... thanks to anyone who responsed..

regards Omid




Martin Marinschek wrote:
>
> Is the phase-listener not found at all?
>
> Is the class-name correct? on the first glance, I'd suspect the main.
> is too much.
>
> regards,
>
> Martin
>
> On 5/16/07, omidh <[EMAIL PROTECTED]> wrote:
>>
>> Thank you very much for your response,
>> On your advice I wrote an PahseListener but it doesn't work. I don't know
>> if
>> it is a config failure or not.
>> The problem is I think that in my web.xml the Extension-filter is set to
>> false.
>>
>> 
>>
>> org.apache.myfaces.CHECK_EXTENSIONS_FILTER
>> false
>> 
>> thats because I use the tomahawk-bridge in my portlet and for these the
>> Extension-filter must be shutdown.
>> is these the reason???
>>
>> in my faces-config.xml I did the following to run the phaseListener:
>> 
>>
>> 
main.org.jboss.portlet.milestone.portlet.phaselistener.ImagePhaseListener
>> 
>>
>> thanks,
>>
>> Omid
>>
>>
>> omidh wrote:
>> >
>> > Hi all,
>> > I would like to show images in my portlet, which are saved in a Mysql
>> db,
>> > so I wrote a servlet
>> > which helps to download files from the db. Now I use these servlet to
>> > receive also the Images but
>> > it does not work... does anyone know a solution?
>> >
>> > here the way I use it:
>> >
>> > 
>> > generated code: < i m g src="/MileStoneBeta/FileServlet/?file_id=1">
>> >
>> > and here the servlet (nothing special):
>> >
>> > protected void doGet(HttpServletRequest request,
>> >   HttpServletResponse response) throws
>> ServletException, IOException {
>> >
>> >   FacesContext fctx = getFacesContext(request, response);
>> >
>> >   ValueBinding bind =
>> FacesContext.getCurrentInstance().getApplication()
>> >   .createValueBinding("#{facadeService}");
>> >   if (bind == null)
>> >   logger.fatal("ValueBinding is null");
>> >
>> >   FacadeService bean = (FacadeService) bind.getValue(fctx);
>> >
>> >
>> >   Integer fileId =
>> Integer.parseInt(request.getParameter("file_id"));
>> >
>> >   UFile file =
>> >
>> (UFile)bean.getMileStoneService().getEntryManager().loadById(UFile.class,
>> > fileId);
>> >   logger.debug("file="+file);
>> >   if(file != null){
>> >   response.se

Re: broken navigation

2007-05-15 Thread Sorin Silaghi

Can you please send us some details on this ... ? like how do the pages and
action methods look like ?? have you tried to change a commandLink with a
commandButton and see if you get the same errors ?(the unaffected button
might work because of other reasons)

thank you..

On 5/15/07, Shane Petroff <[EMAIL PROTECTED]> wrote:


Hello all,

I have somehow broken my application and can't figure out what I've done
to cause it. Every h:commandLink in my app is currently broken and not
only do I not know why, but I've spent several days working in an area
of the application which is accessible by navigating via a
h:commandButton, so I don't even know when I broke things. CommandLinks
now generate javascript errors either trying to reference a non-existent
component or a non-existent function. Some of the now broken pages have
been unchanged for weeks, others completely reworked. Since navigation
via button works, I can confirm that managed beans are being created and
called, but I can't figure out why the javascript used for commandLinks
gets hosed. Anyone else seen something like this?

--
Shane




Re: Is Navegation Working

2007-05-15 Thread Sorin Silaghi

yes... it is working... if you are getting a page refresh it's because the
outcome dose not fit with any navigation rule... can you post more details
please ?

On 5/15/07, Carlos Ortiz <[EMAIL PROTECTED]> wrote:


Hi ,
Is the Navagation working , I'm just getting a page refresh ¡?





Re: Sandbox behaviour!!

2007-05-15 Thread Mario Ivankovits
Hi!
> try using s:loadBundle instead of f:loadBundle for your messages
If there is only one bundle for your application I'd suggest to
configure it as managed bean (implementing the map interface).

That way you
* can get rid of configuring it on each page
* have it available even for ajax requests
* it is JSF 1.2 like (as far as I know you can configure it there with a
special managed-bean entry)

Ciao,
Mario
>
> regards
>
> Ernst
>
> On 5/15/07, Angel Miralles Arevalo <[EMAIL PROTECTED]> wrote:
>>
>> Hi everybody,
>>
>> can anybody explain me, what are functionalities for sandbox
>> components? For
>> example if you put a message from a ".properties" inside a
>> . When you execute the
>> component (ajax) the message has disappeared!
>>
>> Thank you very much!!
>>
>>  
>>
>> LLama Gratis a cualquier PC del Mundo.
>> Llamadas a fijos y móviles desde 1 céntimo por minuto.
>> http://es.voice.yahoo.com
>



Re: h:graphicImage and Servlets

2007-05-15 Thread omidh

Hi Martin,
thank you for your response,

the class name is correct.
I solved it with my FileServlet now.
The problem in the servlet was (I think) that when showing Image
it may not be set the response.setHeader(...), now the code look like these

To whom it may interest:

protected void doGet(HttpServletRequest request,
HttpServletResponse response) throws ServletException, 
IOException {

FacesContext fctx = getFacesContext(request, response);

ValueBinding bind = 
FacesContext.getCurrentInstance().getApplication()
.createValueBinding("#{facadeService}");

FacadeService bean = (FacadeService) bind.getValue(fctx);

if (logger.isDebugEnabled())
logger.debug("Bean=" + bean);   

OutputStream out = response.getOutputStream();

Integer fileId = 
Integer.parseInt(request.getParameter("file_id"));

UFile file =
(UFile)bean.getMileStoneService().getEntryManager().loadById(UFile.class,
fileId);
logger.debug("file="+file);
if(file != null){
response.setContentType(file.getContentType());
response.setContentLength(file.getContent().length);
if(file.getContentType().indexOf("image") == -1){
response.setHeader("Content-Disposition", 
"attachement; filename=\"" + 
file.getFileName() + "\"");
}
if(logger.isDebugEnabled())
logger.debug("sending file ...");
out.write(file.getContent());
out.flush();
out.close();
response.flushBuffer();
}

as you can see the changes are minimal...
don't forget to add the following to the web.xml:


FileServlet
File servlet
Servlet used to view or download an Image or
document
   
main.org.jboss.portlet.milestone.servlet.FileServlet



FileServlet
/FileServlet/*


and the call for me from a jsp:



so again... thanks to anyone who responsed..

regards Omid




Martin Marinschek wrote:
> 
> Is the phase-listener not found at all?
> 
> Is the class-name correct? on the first glance, I'd suspect the main.
> is too much.
> 
> regards,
> 
> Martin
> 
> On 5/16/07, omidh <[EMAIL PROTECTED]> wrote:
>>
>> Thank you very much for your response,
>> On your advice I wrote an PahseListener but it doesn't work. I don't know
>> if
>> it is a config failure or not.
>> The problem is I think that in my web.xml the Extension-filter is set to
>> false.
>>
>> 
>>
>> org.apache.myfaces.CHECK_EXTENSIONS_FILTER
>> false
>> 
>> thats because I use the tomahawk-bridge in my portlet and for these the
>> Extension-filter must be shutdown.
>> is these the reason???
>>
>> in my faces-config.xml I did the following to run the phaseListener:
>> 
>>
>> main.org.jboss.portlet.milestone.portlet.phaselistener.ImagePhaseListener
>> 
>>
>> thanks,
>>
>> Omid
>>
>>
>> omidh wrote:
>> >
>> > Hi all,
>> > I would like to show images in my portlet, which are saved in a Mysql
>> db,
>> > so I wrote a servlet
>> > which helps to download files from the db. Now I use these servlet to
>> > receive also the Images but
>> > it does not work... does anyone know a solution?
>> >
>> > here the way I use it:
>> >
>> > 
>> > generated code: < i m g src="/MileStoneBeta/FileServlet/?file_id=1">
>> >
>> > and here the servlet (nothing special):
>> >
>> > protected void doGet(HttpServletRequest request,
>> >   HttpServletResponse response) throws
>> ServletException, IOException {
>> >
>> >   FacesContext fctx = getFacesContext(request, response);
>> >
>> >   ValueBinding bind =
>> FacesContext.getCurrentInstance().getApplication()
>> >   .createValueBinding("#{facadeService}");
>> >   if (bind == null)
>> >   logger.fatal("ValueBinding is null");
>> >
>> >   FacadeService bean = (FacadeService) bind.getValue(fctx);
>> >
>> >
>> >   Integer fileId =
>> Integer.parseInt(request.getParameter("file_id"));
>> >
>> >   UFile file =
>> >
>> (UFile)bean.getMileStoneService().getEntryManager().loadById(UFile.class,
>> > fileId);
>> >   logger.debug("file="+file);
>> >   if(file != null){
>> >   response.setContentType(file.getContentType());
>> >  
>> response.setContentLength(file.getContent().length);
>> >   response.setHeader("Content-Disposition",
>> "attachement; filename=\"" +
>> >   

Re: h:graphicImage and Servlets

2007-05-15 Thread Martin Marinschek

Is the phase-listener not found at all?

Is the class-name correct? on the first glance, I'd suspect the main.
is too much.

regards,

Martin

On 5/16/07, omidh <[EMAIL PROTECTED]> wrote:


Thank you very much for your response,
On your advice I wrote an PahseListener but it doesn't work. I don't know if
it is a config failure or not.
The problem is I think that in my web.xml the Extension-filter is set to
false.


org.apache.myfaces.CHECK_EXTENSIONS_FILTER
false

thats because I use the tomahawk-bridge in my portlet and for these the
Extension-filter must be shutdown.
is these the reason???

in my faces-config.xml I did the following to run the phaseListener:


main.org.jboss.portlet.milestone.portlet.phaselistener.ImagePhaseListener


thanks,

Omid


omidh wrote:
>
> Hi all,
> I would like to show images in my portlet, which are saved in a Mysql db,
> so I wrote a servlet
> which helps to download files from the db. Now I use these servlet to
> receive also the Images but
> it does not work... does anyone know a solution?
>
> here the way I use it:
>
> 
> generated code: < i m g src="/MileStoneBeta/FileServlet/?file_id=1">
>
> and here the servlet (nothing special):
>
> protected void doGet(HttpServletRequest request,
>   HttpServletResponse response) throws ServletException, 
IOException {
>
>   FacesContext fctx = getFacesContext(request, response);
>
>   ValueBinding bind = 
FacesContext.getCurrentInstance().getApplication()
>   .createValueBinding("#{facadeService}");
>   if (bind == null)
>   logger.fatal("ValueBinding is null");
>
>   FacadeService bean = (FacadeService) bind.getValue(fctx);
>
>
>   Integer fileId = 
Integer.parseInt(request.getParameter("file_id"));
>
>   UFile file =
> (UFile)bean.getMileStoneService().getEntryManager().loadById(UFile.class,
> fileId);
>   logger.debug("file="+file);
>   if(file != null){
>   response.setContentType(file.getContentType());
>   response.setContentLength(file.getContent().length);
>   response.setHeader("Content-Disposition", "attachement; 
filename=\"" +
>   file.getFileName() + "\"");
>   if(logger.isDebugEnabled())
>   logger.debug("sending file ...");
>   response.getOutputStream().write(file.getContent());
>   response.flushBuffer();
>   }
>
>   }
>
> or is there a simple way to do it? ;)
>
> thanks in advance,
> Omid
>

--
View this message in context: 
http://www.nabble.com/h%3AgraphicImage-and-Servlets-tf3757832.html#a10635281
Sent from the MyFaces - Users mailing list archive at Nabble.com.





--

http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces


Re: h:graphicImage and Servlets

2007-05-15 Thread omidh

Thank you very much for your response,
On your advice I wrote an PahseListener but it doesn't work. I don't know if
it is a config failure or not.
The problem is I think that in my web.xml the Extension-filter is set to
false.


org.apache.myfaces.CHECK_EXTENSIONS_FILTER
false
 
thats because I use the tomahawk-bridge in my portlet and for these the
Extension-filter must be shutdown.
is these the reason???

in my faces-config.xml I did the following to run the phaseListener:


main.org.jboss.portlet.milestone.portlet.phaselistener.ImagePhaseListener


thanks,

Omid


omidh wrote:
> 
> Hi all,
> I would like to show images in my portlet, which are saved in a Mysql db,
> so I wrote a servlet
> which helps to download files from the db. Now I use these servlet to
> receive also the Images but 
> it does not work... does anyone know a solution?
> 
> here the way I use it:
> 
> 
> generated code: < i m g src="/MileStoneBeta/FileServlet/?file_id=1">
> 
> and here the servlet (nothing special):
> 
> protected void doGet(HttpServletRequest request,
>   HttpServletResponse response) throws ServletException, 
> IOException {
> 
>   FacesContext fctx = getFacesContext(request, response);
>   
>   ValueBinding bind = 
> FacesContext.getCurrentInstance().getApplication()
>   .createValueBinding("#{facadeService}");
>   if (bind == null)
>   logger.fatal("ValueBinding is null");
> 
>   FacadeService bean = (FacadeService) bind.getValue(fctx);
>   
>   
>   Integer fileId = 
> Integer.parseInt(request.getParameter("file_id"));
>   
>   UFile file =
> (UFile)bean.getMileStoneService().getEntryManager().loadById(UFile.class,
> fileId);
>   logger.debug("file="+file);
>   if(file != null){
>   response.setContentType(file.getContentType());
>   response.setContentLength(file.getContent().length);
>   response.setHeader("Content-Disposition", "attachement; 
> filename=\"" + 
>   file.getFileName() + "\"");
>   if(logger.isDebugEnabled())
>   logger.debug("sending file ...");
>   response.getOutputStream().write(file.getContent());
>   response.flushBuffer();
>   }
>   
>   }
> 
> or is there a simple way to do it? ;)
> 
> thanks in advance,
> Omid
> 

-- 
View this message in context: 
http://www.nabble.com/h%3AgraphicImage-and-Servlets-tf3757832.html#a10635281
Sent from the MyFaces - Users mailing list archive at Nabble.com.



Re: Source code of myfaces and tomahawa 1.1.3

2007-05-15 Thread Dennis Byrne

http://svn.apache.org/viewvc/myfaces/tomahawk/tags/1_1_3/

http://svn.apache.org/viewvc/myfaces/core/tags/1_1_3/

Dennis Byrne

On 5/15/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]>
wrote:


 Where can I find the source code of myfaces and tomahawk 1.1.3?



Thanks in advance

Mario Buonopane



This message is for the designated recipient only and may contain
privileged, proprietary, or otherwise private information. If you have
received it in error, please notify the sender immediately and delete the
original. Any other use of the email by you is prohibited.





--
Dennis Byrne


Re: [Trinidad] Trunk and 1.2 both deployed, site too!

2007-05-15 Thread Matthias Wessendorf

jsf 1.1 => trunk
jsf 1.2 => branch

On 5/15/07, noah <[EMAIL PROTECTED]> wrote:

Are there any major differences between the trunk and 1.2?
e.g. Is the TrinidadFilter still necessary?  Has the behavior of PPR
changed at all?

On 5/15/07, Adam Winer <[EMAIL PROTECTED]> wrote:
> Thanks to all of Wendy Smoak's work getting the Continuum
> server running and her advice, I've set up the Trinidad trunk
> and current 1.2 branch to have nightly auto-deploys, for
> example:
>
> 
http://people.apache.org/repo/m2-snapshot-repository/org/apache/myfaces/trinidad/trinidad-api/1.0.1-SNAPSHOT/
> 
http://people.apache.org/repo/m2-snapshot-repository/org/apache/myfaces/trinidad/trinidad-api/1.2-07-apr-SNAPSHOT/
>
> And the Trinidad site is now up where it should be,
> Javadoc, tagdoc, devguide and all:
>
> http://myfaces.apache.org/trinidad/
>
> (The style doesn't match the main myfaces site - something
> to work on soon...)
>
> Cheers,
> Adam
>




--
Matthias Wessendorf
http://tinyurl.com/fmywh

further stuff:
blog: http://jroller.com/page/mwessendorf
mail: mwessendorf-at-gmail-dot-com


[COMMUNITY] Matt Cooper - Committer

2007-05-15 Thread Matthias Wessendorf

Congratulations to Matt Cooper for becoming the newest Myfaces committer !

Matt has provided patches to Trinidad and has been active on the
mailing list to help other users on how to get up to speed with
Trinidad.

Thanks Matt, and welcome to the team!

--
Matthias Wessendorf
http://tinyurl.com/fmywh

further stuff:
blog: http://jroller.com/page/mwessendorf
mail: mwessendorf-at-gmail-dot-com


Issue with commandLlink and commandButton with popup.

2007-05-15 Thread Anil
Hi,

I am using Myfaces 1.4, Facelets and Spring Webflow in my project. I have a
problem working with 'commandLink' and 'commandButton'.

In my Page, I have a 'link'(commandLink) and a 'button'(commandButton).

Desired behavior is that when I click on link, it should popup a window and
submit the form and keep target to opened popup. It is working fine.

The following is the code:

Facelet
---


javascript
---

function openWindow() {
var url = "";

window.open(url,'testWindow',"height=650,width=700,top=50,left=200,toolbar
=0,location=0,status=0,menuBar=0,scrollBars=1,resizable=yes");
}



for button, when I click on it, it should actually submits my form for
processing and shows the next page in the flow. It is also working fine. The
following is the code

Facelet
---



Issue:

Issue is when my page is rendered, if I click on button it is working as I
expected. But If I click on the link (which would open a popup) and after
that I click on this button, surprisingly it is opening the popup(instead of
processing the form and showing the next page).

Any ideas on why this is happening. I am not really sure whether this is
generic javascript issue or myfaces related issue. Please advice.

Thanks in advance.

Thanks,
Anil.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [Trinidad] Trunk and 1.2 both deployed, site too!

2007-05-15 Thread noah

Are there any major differences between the trunk and 1.2?
e.g. Is the TrinidadFilter still necessary?  Has the behavior of PPR
changed at all?

On 5/15/07, Adam Winer <[EMAIL PROTECTED]> wrote:

Thanks to all of Wendy Smoak's work getting the Continuum
server running and her advice, I've set up the Trinidad trunk
and current 1.2 branch to have nightly auto-deploys, for
example:

http://people.apache.org/repo/m2-snapshot-repository/org/apache/myfaces/trinidad/trinidad-api/1.0.1-SNAPSHOT/
http://people.apache.org/repo/m2-snapshot-repository/org/apache/myfaces/trinidad/trinidad-api/1.2-07-apr-SNAPSHOT/

And the Trinidad site is now up where it should be,
Javadoc, tagdoc, devguide and all:

http://myfaces.apache.org/trinidad/

(The style doesn't match the main myfaces site - something
to work on soon...)

Cheers,
Adam



Re: [Trinidad] Trunk and 1.2 both deployed, site too!

2007-05-15 Thread Matthias Wessendorf

Perhaps a good time to make 1.2 trunk is,
when MyFaces trunk also is 1.2 ?

-m

On 5/15/07, Adam Winer <[EMAIL PROTECTED]> wrote:

It's quite robust.  I'd like to get out a real release
of it soon after 1.0.1 on trunk.  I don't think we've
really talked much about when 1.2 might become
trunk, though.

-- Adam


On 5/15/07, Brian Smith <[EMAIL PROTECTED]> wrote:
> Great news Adam!
>
> Can you tell me what the current status of the 1.2 Branch is?  Any future
> release/trunk dates?
>
>
> On 5/15/07, Adam Winer < [EMAIL PROTECTED]> wrote:
> > Thanks to all of Wendy Smoak's work getting the Continuum
> > server running and her advice, I've set up the Trinidad trunk
> > and current 1.2 branch to have nightly auto-deploys, for
> > example:
> >
> >
> 
http://people.apache.org/repo/m2-snapshot-repository/org/apache/myfaces/trinidad/trinidad-api/1.0.1-SNAPSHOT/
> >
> 
http://people.apache.org/repo/m2-snapshot-repository/org/apache/myfaces/trinidad/trinidad-api/1.2-07-apr-SNAPSHOT/
> >
> > And the Trinidad site is now up where it should be,
> > Javadoc, tagdoc, devguide and all:
> >
> > http://myfaces.apache.org/trinidad/
> >
> > (The style doesn't match the main myfaces site - something
> > to work on soon...)
> >
> > Cheers,
> > Adam
> >
>
>




--
Matthias Wessendorf
http://tinyurl.com/fmywh

further stuff:
blog: http://jroller.com/page/mwessendorf
mail: mwessendorf-at-gmail-dot-com


Re: [Trinidad] Trunk and 1.2 both deployed, site too!

2007-05-15 Thread Matthias Wessendorf

Adam,

when putting the release together next month,
I need to change the "artifacts" (jar names). So I can do also a bit
work on the page.

But for now, let's keep it like it is, right ?

-M

On 5/15/07, Adam Winer <[EMAIL PROTECTED]> wrote:

Thanks to all of Wendy Smoak's work getting the Continuum
server running and her advice, I've set up the Trinidad trunk
and current 1.2 branch to have nightly auto-deploys, for
example:

http://people.apache.org/repo/m2-snapshot-repository/org/apache/myfaces/trinidad/trinidad-api/1.0.1-SNAPSHOT/
http://people.apache.org/repo/m2-snapshot-repository/org/apache/myfaces/trinidad/trinidad-api/1.2-07-apr-SNAPSHOT/

And the Trinidad site is now up where it should be,
Javadoc, tagdoc, devguide and all:

http://myfaces.apache.org/trinidad/

(The style doesn't match the main myfaces site - something
to work on soon...)

Cheers,
Adam




--
Matthias Wessendorf
http://tinyurl.com/fmywh

further stuff:
blog: http://jroller.com/page/mwessendorf
mail: mwessendorf-at-gmail-dot-com


Re: [Trinidad] Trunk and 1.2 both deployed, site too!

2007-05-15 Thread Adam Winer

It's quite robust.  I'd like to get out a real release
of it soon after 1.0.1 on trunk.  I don't think we've
really talked much about when 1.2 might become
trunk, though.

-- Adam


On 5/15/07, Brian Smith <[EMAIL PROTECTED]> wrote:

Great news Adam!

Can you tell me what the current status of the 1.2 Branch is?  Any future
release/trunk dates?


On 5/15/07, Adam Winer < [EMAIL PROTECTED]> wrote:
> Thanks to all of Wendy Smoak's work getting the Continuum
> server running and her advice, I've set up the Trinidad trunk
> and current 1.2 branch to have nightly auto-deploys, for
> example:
>
>
http://people.apache.org/repo/m2-snapshot-repository/org/apache/myfaces/trinidad/trinidad-api/1.0.1-SNAPSHOT/
>
http://people.apache.org/repo/m2-snapshot-repository/org/apache/myfaces/trinidad/trinidad-api/1.2-07-apr-SNAPSHOT/
>
> And the Trinidad site is now up where it should be,
> Javadoc, tagdoc, devguide and all:
>
> http://myfaces.apache.org/trinidad/
>
> (The style doesn't match the main myfaces site - something
> to work on soon...)
>
> Cheers,
> Adam
>




Re: and datascroller

2007-05-15 Thread Ernst Fastl

Seems to work fine for me on:

http://example.irian.at/example-sandbox-20070514/pprPanelGroupDataScroller.jsf

what exactly do you mean?

On 5/11/07, Angel Miralles Arevalo <[EMAIL PROTECTED]> wrote:


Hi everybody,

can anybody tell me why, when you have a datatable with datascroller inside
label:  the internal
datascroller variables (pageIndex,...) don't refresh until you go to server.

Thank you very much...

 

LLama Gratis a cualquier PC del Mundo.
Llamadas a fijos y móviles desde 1 céntimo por minuto.
http://es.voice.yahoo.com


Re: Sandbox behaviour!!

2007-05-15 Thread Ernst Fastl

sounds familiar

try using s:loadBundle instead of f:loadBundle for your messages

regards

Ernst

On 5/15/07, Angel Miralles Arevalo <[EMAIL PROTECTED]> wrote:


Hi everybody,

can anybody explain me, what are functionalities for sandbox components? For
example if you put a message from a ".properties" inside a
. When you execute the
component (ajax) the message has disappeared!

Thank you very much!!

 

LLama Gratis a cualquier PC del Mundo.
Llamadas a fijos y móviles desde 1 céntimo por minuto.
http://es.voice.yahoo.com


broken navigation

2007-05-15 Thread Shane Petroff

Hello all,

I have somehow broken my application and can't figure out what I've done 
to cause it. Every h:commandLink in my app is currently broken and not 
only do I not know why, but I've spent several days working in an area 
of the application which is accessible by navigating via a  
h:commandButton, so I don't even know when I broke things. CommandLinks 
now generate javascript errors either trying to reference a non-existent 
component or a non-existent function. Some of the now broken pages have 
been unchanged for weeks, others completely reworked. Since navigation 
via button works, I can confirm that managed beans are being created and 
called, but I can't figure out why the javascript used for commandLinks 
gets hosed. Anyone else seen something like this?


--
Shane



Re: Form-Based Authentication and URL

2007-05-15 Thread Erlend Hamnaberg

syllepsa wrote:

Hi,

1. In my application I decided to use  Form-Based Authentication. The
problem is that whenever I enter protected resource  area for the first time
I am not rededirected to the login page.  That's related with the fact that
JSF holds the old URL (the one the action came from). I read that I can use
redirect tag on each unprotected page but in this case I can forget about
using validators and saveState. Shall I forget about using Form-Based
Authentication and write custom PhaseListener ?
  
Create a filter that checks your credentials before you are allowed 
access to the protected area.
You may for instance use www.acegisecurity.org which have filter based 
access to protected areas. You may also change your auth scheme by 
configuration. How to implement this is IMHV  beyond the scope of this 
mailing list.

2. If JSF holds an old URL in internet browser then how to design an
application which will forward me to the desired webpage. For exmple I have
forum app. I 've founded an intersting topic. I decided to copy its URL.
Next day I paste the topic URL into my browser but I am redirected to the
wrong page.

I am using MyFaces 1.1.4

Regards,

Mariusz
   
  




Localization: get/setLocale before other managed beans execute?

2007-05-15 Thread Cort, Tom
Greetings List Lurkers,

I'm localizing a myfaces application and I'm having trouble changing the
locale before my managed beans load a locale specific resource bundle. If
anyone has any hints, ideas or links, it would be greatly appreciated. Thank
you!

Expected Results


The goal is to have a drop down menu in the corner with the available
languages. The user will select a language and the page will re-load in that
language. The correct language should be automatically selected when the
user first visits the page based on the browser's language settings.

Actual Results
--

I have this mostly working. When the browser's locale is set to 'fr', the
page loads in French. I can select 'English' from the drop down menu and the
page re-loads in English. The only problem is with a bean that I'm using to
dynamically generate navigation menus. When the user selects a locale, the
page reloads in the proper language, but the menus are still in the previous
language (i.e. getLocale() returns the previous locale). The menus are in
English on the next reload (i.e. the new locale is returned on the next page
loads).

Example of the Problem
--

- The user's browser's locale is set to 'fr'
- The user visits /welcome.faces and the page loads in French
- The user selects the 'English' locale which submits the form to
/welcome.faces
- /welcome.faces loads and everything is in English except the menu which is
still in French
- The user types /welcome.faces in the browser's location bar and presses
enter
- The page reloads and now everything (including the menus) is in English.

What I think is Happening
-

The bean that generates the navigation menus is executing before the locale
is set.

Questions
-

Is there a way to set the locale before my other beans call getLocale(), or
maybe there is a way to tell it to process the form before the other beans
execute? Is there a better way to do what I want, I'm sort of new to
JavaServer Faces?

Things I've Tried
-

I tried accessing my localesBean via "#{localesBean.locale}" (source below)
from leftNavBean (source below), but I get the same results.

Some Ideas I've Had
---

One idea I have is to create a JSP ('bounce.jsp'). When the locale is
changed, the user is sent to bounce.jsp. When the user gets to bounce.jsp,
it displays "Locale Changed" and redirects him back to the original page.
While I think this would work, it isn't ideal.

Relevant Source Code / Config Settings
--

If you need more than this, let me know.

The following 3 files exist in WEB-INF/classes
LocalizationResources.properties
LocalizationResources_en.properties
LocalizationResources_fr.properties

---
--- locale drop down list
---




 


---
--- an example faces page
---

<%@ taglib uri="http://java.sun.com/jsf/core"; prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsf/html"; prefix="h" %>
<%@ taglib uri="/WEB-INF/tlds/portal-taglib.tld" prefix="portal" %>
<%@ taglib tagdir="/WEB-INF/tags/layout" prefix="layout" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
















---
--- LeftNavBean.java (the relevant part)
---

public NavBeanBase[] getAllLinks() {
ResourceBundle txt =
ResourceBundle.getBundle("LocalizationResources",
FacesContext.getCurrentInstance().getViewRoot().getLocale());

// was a DB call
TopNavBean[] links = {
new
TopNavBean(txt.getString("urlFoo"),txt.getString("urlFooDisplay")),
new
TopNavBean(txt.getString("urlBar"),txt.getString("urlBarDisplay "))
};

return links;
}

---
--- LocaleBean.java
---

public class LocaleBean {

private String locale = null;

public String getLocale() {
if (this.locale == null) {
this.locale =
FacesContext.getCurrentInstance().getViewRoot().getLocale().toString();
}

return locale;
}

public String 

Source code of myfaces and tomahawa 1.1.3

2007-05-15 Thread mario.buonopane
Where can I find the source code of myfaces and tomahawk 1.1.3?

 

Thanks in advance

Mario Buonopane

 



This message is for the designated recipient only and may contain privileged, 
proprietary, or otherwise private information.  If you have received it in 
error, please notify the sender immediately and delete the original.  Any other 
use of the email by you is prohibited.


[Trinidad] PPR Using Browser Back/Refresh Buttons

2007-05-15 Thread William Hoover
Are there any documented issues when performing a PPR and the browser 
back/refresh buttons are used?



How to remove the UI component state?

2007-05-15 Thread Leyzerzon, Simeon
Hi,

I have a requirement whereby one needs to clean all the state before 
re-rendering a page when clicking on a tab.  The way I implemented it is when 
tab is clicked the request goes to a servlet which clean the session with 
regards to the contents of the managed beans.  Unfortunately, the UI component 
state still seems to be present and remembered so the page doesn't refresh 
competely. 

What would be the syntax to clean the UI component state alltogether in Java 
within a servlet?

I have this in my web.xml:


javax.faces.STATE_SAVING_METHOD
session


Thank you,
Simeon


==
Please access the attached hyperlink for an important electronic communications 
disclaimer: 

http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
==


Re: using portlet modes

2007-05-15 Thread Ryan Wynn

On 5/11/07, Alexander Wallace <[EMAIL PROTECTED]> wrote:

I can't find much info about the suggestion you make in google... Any
more details are greatly appreciated... Thanks!


what I meant is that command buttons and command links have an
attribute called action which is set to a method binding expression.
This method will be invoked in the jsf process action phase.  Inside
this method it is ok to change the portlet mode.  You do not need to
introduce phase listeners.




On May 10, 2007, at 6:07 PM, Ryan Wynn wrote:

> On 5/10/07, Alexander Wallace <[EMAIL PROTECTED]> wrote:
>> Hi All... I'm finding using portlet modes in jsf at the very least
>> cumbersome... Is this really how it is? Should I just forget about
>> portlet modes and use jsf navigation rules to compensate?
>>
>> I'm doing stuff like this: If you hit the edit icon you are taken to
>> the edit jsp correctly (so far so good) via override to doEdit and
>> calling nonFacesRequest
>>
>> However, when I want to switch back to view mode, I'm having to
>> override processAction where i can switch the mode, however, i can't
>> see any of the parameters and attributes changed in portlet request
>> by my bean action listeners... So... i either use a session attribute
>> or do the switch blindly...
>
> You should not have to override processAction in MyFacesGenericPortlet
> to accomplish this.  You can change the portlet mode during the
> process action phase of the jsf lifecycle because this phase happens
> within the portlet action phase.  You will, however, have to cast the
> to portlet specific objects from the external context because jsf does
> not provide a portlet api.
>
>
>>
>> Worse, switching modes doesn't change the VIEW_ID (expected) but i
>> seem to only be able to change that back in doView now (since i
>> changed mode back to view) by checking if i was looking at my "edit"
>> view page... Still is too late to validate if i really wanted to go
>> there...
>>
>> Is this really how it is done? Anyone else using portlet modes?
>>
>> Thanks in advance!
>>
>>
>




Is Navegation Working

2007-05-15 Thread Carlos Ortiz

Hi ,
Is the Navagation working , I'm just getting a page refresh ¡?




Tree2 and TreeNodeBase extension in Tomahawk 1.1.3?

2007-05-15 Thread Nebinger, David
Okay, so I've got the following tree2 'goal':


  

  

  
  


  

  



Basically I'd like to keep the icon to display with the tree node itself
rather than having to create multiple facets just for an icon change.

Unfortunately it appears (at least in tomahawk 1.1.3) that my extension
for node is not visible in the  tag.  Even though I'm
putting my extension node into the tree (with the appropriate
getters/setters for iconImage in the extension guy), I guess that when
node is provided to the tree implementation it is a simple TreeNode
interface object and cannot get to my extension points.

Anybody like to suggest how I might accomplish this?



Re: t:dataScroller: paginator table missing!

2007-05-15 Thread Marcus Beyer


Am 15.05.2007 um 16:01 schrieb Marcus Beyer:


Is this a bug? I can't find an issue in JIRA …


I just created one:

https://issues.apache.org/jira/browse/TOMAHAWK-989



Re: [Trinidad] Trunk and 1.2 both deployed, site too!

2007-05-15 Thread Brian Smith

Great news Adam!

Can you tell me what the current status of the 1.2 Branch is?  Any future
release/trunk dates?

On 5/15/07, Adam Winer <[EMAIL PROTECTED]> wrote:


Thanks to all of Wendy Smoak's work getting the Continuum
server running and her advice, I've set up the Trinidad trunk
and current 1.2 branch to have nightly auto-deploys, for
example:


http://people.apache.org/repo/m2-snapshot-repository/org/apache/myfaces/trinidad/trinidad-api/1.0.1-SNAPSHOT/

http://people.apache.org/repo/m2-snapshot-repository/org/apache/myfaces/trinidad/trinidad-api/1.2-07-apr-SNAPSHOT/

And the Trinidad site is now up where it should be,
Javadoc, tagdoc, devguide and all:

http://myfaces.apache.org/trinidad/

(The style doesn't match the main myfaces site - something
to work on soon...)

Cheers,
Adam



[Trinidad] Trunk and 1.2 both deployed, site too!

2007-05-15 Thread Adam Winer

Thanks to all of Wendy Smoak's work getting the Continuum
server running and her advice, I've set up the Trinidad trunk
and current 1.2 branch to have nightly auto-deploys, for
example:

http://people.apache.org/repo/m2-snapshot-repository/org/apache/myfaces/trinidad/trinidad-api/1.0.1-SNAPSHOT/
http://people.apache.org/repo/m2-snapshot-repository/org/apache/myfaces/trinidad/trinidad-api/1.2-07-apr-SNAPSHOT/

And the Trinidad site is now up where it should be,
Javadoc, tagdoc, devguide and all:

http://myfaces.apache.org/trinidad/

(The style doesn't match the main myfaces site - something
to work on soon...)

Cheers,
Adam


Re: tx:date got a day before selected date

2007-05-15 Thread Volker Weber

http://wiki.apache.org/myfaces/FAQ#Date

or

http://tinyurl.com/34zngs


2007/5/15, Jonathan Obregon A <[EMAIL PROTECTED]>:


Hi all,

Here's my problem: when I select a date in 

The taglib is: <%@ taglib
uri="http://myfaces.apache.org/tobago/extension"; prefix="tx" %>

Thanks!



Re: Struts JSTL Migration

2007-05-15 Thread ::SammyRulez::

I have solved the same problem moths ago.

I supose you have dom and xslt/dom in the xml and xslt vars.

I developed a managedbean based on dom4j.

Move the code you youe to ooad xml and xslt to that bean and make a
getTransformedData() method like this

public String getTransformedData() {
 // load the transformer using JAXP
   TransformerFactory factory = TransformerFactory.newInstance();
   Transformer transformer = factory.newTransformer(
   new StreamSource( stylesheet )
   );

   // now lets style the given document
   DocumentSource source = new DocumentSource( document );
   DocumentResult result = new DocumentResult();
   transformer.transform( source, result );

   // return the transformed document
   Document transformedDoc = result.getDocument();
   return transformedDoc.asXML();
}


where document and stylesheet are your old xml and xslt.


then replace your tag with a simple





2007/5/15, Kevin Gutch <[EMAIL PROTECTED]>:

Hi,

I have an existing application that I am completely migrating to JSF.
Everything seems fine but I am trying to figure out what to do with an
area of the app where I use
. This does not want to seem
to work with JSF. Should it? If not what are my alternatives?

Thanks

Kevin





--
::SammyRulez::
http://www.kyub.com/blog/
-
La programmazione è per un terzo interpretazione e per due terzi ispirazione.
E per un terzo mistificazione


tx:date got a day before selected date

2007-05-15 Thread Jonathan Obregon A


Hi all,

Here's my problem: when I select a date in is a day before than selected one.  By example, I select May 14 in 
calendar, and the value in the java bean is May 13. Could you help me 
with this problem?


The code is:
value="#{reportingAccountDepositPage.endTime}"/>


The taglib is: <%@ taglib 
uri="http://myfaces.apache.org/tobago/extension"; prefix="tx" %>


Thanks!


Struts JSTL Migration

2007-05-15 Thread Kevin Gutch

Hi,

I have an existing application that I am completely migrating to JSF. 
Everything seems fine but I am trying to figure out what to do with an 
area of the app where I use
. This does not want to seem 
to work with JSF. Should it? If not what are my alternatives?


Thanks

Kevin


smime.p7s
Description: S/MIME Cryptographic Signature


Re: [ANNOUNCE] MyFaces Core v1.1.5 Release

2007-05-15 Thread Matthias Wessendorf

252, we need to wait for the official stamp, that we can say, we passed.

The TCK itself is available to us, yes

-M

On 5/15/07, Jesse Alexander (KSFD 121)
<[EMAIL PROTECTED]> wrote:

Hi

Just checked that page... And I think there is a slight error...

In the table named "The ASF have licensed the following TCKs:"
JSR-127 : JavaServer Faces  1.2_03  5-Dec-2006

to seems wrong...

JSR-127 is JSF 1.1
JSR-252 would be JSF 1.2

regards
Alexander

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of
Matthias Wessendorf
Sent: Monday, May 14, 2007 6:47 PM
To: MyFaces Discussion
Subject: Re: [ANNOUNCE] MyFaces Core v1.1.5 Release

We should list this release here:

http://apache.org/jcp/

-M

On 2/19/07, Manfred Geiler <[EMAIL PROTECTED]> wrote:
> The Apache MyFaces team is pleased to announce the release of MyFaces
> Core 1.1.5.
>
> MyFaces Core is a JavaServer(tm) Faces 1.1 implementation as specified
> by JSR-127.  MyFaces Core has passed Sun's JSR-127 TCK and is 100%
> compliant with the JSR-127 specification.
>
> MyFaces Core 1.1.5 is available in both binary and source
distributions.
>
> * http://myfaces.apache.org/download.html
>
> MyFaces Core is also available in the central Maven repository under
> Group ID "org.apache.myfaces.core".
>
> Release Notes - MyFaces Core - Version 1.1.5
>  ** Fixed Bugs
> * [MYFACES-437] -  does not work  with  
> * [MYFACES-660] - (Patch provided) "request scoping" from Portlet
> Action- to RenderRequest should not occur via Attribute Request Map
> * [MYFACES-689] - PropertyResolverImpl.getType(Object base, int
> index) return null if base instanceof Object[]
> * [MYFACES-731] - selectManyListbox calls converter getAsString
> passing in string value during form post
> * [MYFACES-828] - HtmlCheckboxRenderer ignores readonly
> * [MYFACES-968] - LifecycleImpl's restoreView throws NPE when
> viewId is null in a portlet context
> * [MYFACES-1025] - panelGrid does always render a border-attribute
> * [MYFACES-1029] - Duplicate sibling ids allowed
> * [MYFACES-1304] - DigesterFacesConfigDispenserImpl shuld respect
> order of registered renderkits
> * [MYFACES-1328] - UISelectOne and UISelectMany fail with custom
> converter that returns java.lang.String from getAsObject() method.
> * [MYFACES-1368] - Fix case sensitivity for context params
> * [MYFACES-1384] - After switch from myfaces-impl-1.1.3 (release)
> to myfaces-1.1.5-SNAPSHOT, javascript throw error 'Object expected'
> * [MYFACES-1386] - PropertyResolverImpl.setProperty lacks usefull
> error mesage if write method not found
> * [MYFACES-1393] - MyFaces state information is rendered by
MyFaces Form
> * [MYFACES-1397] - getValidJavascriptNameAsInRI throws
> java.lang.IllegalArgumentException: Illegal group reference
> * [MYFACES-1406] - Core and Shared project has dependency on
> myfaces:myfaces-api version 1.1.1
> * [MYFACES-1407] - JS oamSubmitForm() params order incorrect
> * [MYFACES-1410] - CLONE -PropertyResolverImpl.getType(Object
> base, int index) return null if base instanceof Object[]
> * [MYFACES-1412] - Restore view phase does not conforms
specification
> * [MYFACES-1413] - JS error in function oamSubmitForm(...)
> * [MYFACES-1415] - WebXmlParser needs to be aware of changes in
> web.xml in version 2.4 of the Servlet spec
> * [MYFACES-1420] - Null Pointer Exception in
> SelectItemsIterator.next() if binding is null
> * [MYFACES-1421] - MyFaces not working with Struts Faces Form
> * [MYFACES-1425] - wrong text for link in getting started
> * [MYFACES-1427] - Error restoring view
> * [MYFACES-1428] - Application cannot be started with Snapshot
> 1.1.5 of 27th Sept./1st Oct.
> * [MYFACES-1430] - selectOneMenu looses values after clicking
> immediate link (since 1.1.4)
> * [MYFACES-1479] - SerialFactory breaks Portlet bridge
> * [MYFACES-1481] - MyFacesGenericPortlet does not work in a
cluster
> * [MYFACES-1486] - Error Handling in Property-Resolver-Impl
> * [MYFACES-1489] - ExternalContext Maps
> * [MYFACES-1490] - DateTimeConverter exception on parsing time
> * [MYFACES-1495] - client side state saving bug
> * [MYFACES-1500] - Default values in standard-faces-config.xml
> * [MYFACES-1510] - h:form does not render accept-charset
>  ** Improvements
> * [MYFACES-652] - Findbugs ant-tasks
> * [MYFACES-1032] - use a javascript method in commondLink for
> lesser html size
> * [MYFACES-1366] - Error in javascript function
> * [MYFACES-1373] - Add exception to logger for output exception
stack trace
> * [MYFACES-1385] - Remove all of the unused code, variables, and
> import statements identified by Eclipse 3.1.2
> * [MYFACES-1405] - Interoperability with Facelets
> * [MYFACES-1411] - Lifecycle phase executions repetitions
> * [MYFACES-1418] - javax.faces.validator - DoubleRangeValidator,
> LengthValidator, 

Re: t:dataScroller: paginator table missing!

2007-05-15 Thread Marcus Beyer


Am 15.05.2007 um 11:41 schrieb Marcus Beyer:

I am using a tomahawk dataScroller together with a tomahawk  
dataTable. Nice.


Then I updated from myFaces 1.1.4 + Tomahawk 1.1.3 to both 1.1.5.

After that update the  around the paginator is missing.
The paginators  elements are there,
but directly besides the other  elements (first, previous,  
etc). Consequently

paginatorTableClass is not used at all.  Any idea?


You can observe this behaviour online:



The HTML looks like this:

…

a>


1
2
3
…

Is this a bug? I can't find an issue in JIRA …

Cheers!
Marcus



Re: MyFaces and Security

2007-05-15 Thread Martin Marinschek

You wouldn't register a phase-listener, you'd rather decorate the
action-listener to find a solution to this.

faces-config.xml:

 your decorator goes here


... the default-action listener calls all actions!

regards,

Martin

On 5/15/07, Petr Kotek <[EMAIL PROTECTED]> wrote:

Hi Rudi,

I am only begginer in JSF and I don't now if exisist better way to
handle login but next code may help You.

PhaseListener
---
public class LoginPhaseListener implements PhaseListener {
  private final String LOGIN_SOURCE = "loginButton";
  private final String METHOD_GET = "GET";
  private final String MAIN_PAGE = "main.jsp";
  private final String LOGIN_PAGE = "index.jsp";

  public LoginPhaseListener() {
  }

  public PhaseId getPhaseId() {
return PhaseId.RESTORE_VIEW;
  }

  public void beforePhase(PhaseEvent phaseEvent) {
  }

  public void afterPhase(PhaseEvent phaseEvent) {
FacesContextctx;
ExternalContext ex;
JSFSession session;
HttpServletRequest hsrq;
String login;
String password;
HttpServletResponse hrsp;

ctx = phaseEvent.getFacesContext();
session =
(JSFSession)ctx.getApplication().createValueBinding("#{JSFSession}").getValue(ctx);
if (!session.isLogged()) {
  ex = ctx.getExternalContext();
  try {
hsrq = (HttpServletRequest)ex.getRequest();
// If source is loginButton, then try doLogin
if (LOGIN_SOURCE.equalsIgnoreCase(hsrq.getParameter("source"))) {
  // Get ifo from login page
  login = hsrq.getParameter("login");
  password = hsrq.getParameter("password");
  // Check it
  if ((login == null) || (password == null) || (login.length()
== 0) || (password.length() == 0))  {
ctx.addMessage(null, new
FacesMessage(FacesMessage.SEVERITY_ERROR, "Login or Password can't be
empty!", null));
  } else if (session.doLogin(login, password)) {
if (METHOD_GET.equalsIgnoreCase(hsrq.getMethod())) {
  // Special login (for debug app - autologin) from request
parameters (?source=loginButton&login=name&password=psw) - redirect to
main.jsp
  ex.redirect(MAIN_PAGE);
}
  } else {
ctx.addMessage(null, new
FacesMessage(FacesMessage.SEVERITY_ERROR, "Bad Login or Password!", null));
  }
} else if (hsrq.getRequestURI().indexOf(LOGIN_PAGE) < 0) {
  ctx.addMessage(null, new
FacesMessage(FacesMessage.SEVERITY_ERROR, "Session Logged Out or
Expired!", null));
  ex.redirect(LOGIN_PAGE);
}
  } catch (Exception e) {
e.printStackTrace();
ctx.addMessage(null, new
FacesMessage(FacesMessage.SEVERITY_ERROR, "Unexpected login error!",
e.getMessage()));
try {
  ex.redirect(LOGIN_PAGE);
} catch (IOException f) {;}
  }
}
  }
}
---
Navigation Handler
---
public class LoginNavigationHandler extends NavigationHandler {
  private final NavigationHandler deflNavHandler;   // Original handler

  public LoginNavigationHandler(NavigationHandler navHandler) {
super();
deflNavHandler = navHandler;
  }

  public void handleNavigation(FacesContext facesContext, String
fromAction, String outcome) {
JSFSession session;
try  {
  session =
(JSFSession)facesContext.getApplication().createValueBinding("#{JSFSession}").getValue(facesContext);
  if (!session.isLogged())  {
outcome = "logout";
  }
} catch (Exception ex)  {
  ex.printStackTrace();
} finally  {
  deflNavHandler.handleNavigation(facesContext, fromAction, outcome);
}
  }
}
---


Where JSFSession is session bean with boolean .isLogged() and boolean
.doLogin(login, password) methods. Actually I checked login/password
against database table with valid users.

Petr



Rudi Steiner wrote:
> Hi Veit,
>
> I don't use spring, so I can't use this mechanism :(
>
> Is there a possibility to get the action to call over the facesContext?
>
> thanks,
> Rudi
>
> On 5/15/07, Walter Oliver (BR/ICI3) <[EMAIL PROTECTED]>
> wrote:
>> Frau Nolte wird heute abend 16:30 erste Testbestellungen absenden.
>>
>> Kunden können ebenso bereits bestellen.
>>
>> Gruss Oliver Walter
>>
>> > -Ursprüngliche Nachricht-
>> > Von: Veit Guna [mailto:[EMAIL PROTECTED]
>> > Gesendet: Dienstag, 15. Mai 2007 12:11
>> > An: MyFaces Discussion
>> > Betreff: Re: MyFaces and Security
>> >
>> > I didn't follow the whole thread, but isn't acegi (if you use
>> > spring) a solution? I use it to protect specific url's as
>> > well es method invocations on backing beans. Works fine for
>> > me (but I'm using spring). I must also admit, that I'm using
>> > jsf-spring to let spring create the backing beans for me (and
>> > thus let acegi take over security).
>> >
>> > /Veit
>> >
>> >
>> >  Original-Nachricht 
>> > Datum: Tue, 15 May 

Form-Based Authentication and URL

2007-05-15 Thread syllepsa

Hi,

1. In my application I decided to use  Form-Based Authentication. The
problem is that whenever I enter protected resource  area for the first time
I am not rededirected to the login page.  That's related with the fact that
JSF holds the old URL (the one the action came from). I read that I can use
redirect tag on each unprotected page but in this case I can forget about
using validators and saveState. Shall I forget about using Form-Based
Authentication and write custom PhaseListener ?

2. If JSF holds an old URL in internet browser then how to design an
application which will forward me to the desired webpage. For exmple I have
forum app. I 've founded an intersting topic. I decided to copy its URL.
Next day I paste the topic URL into my browser but I am redirected to the
wrong page.

I am using MyFaces 1.1.4

Regards,

Mariusz
   
-- 
View this message in context: 
http://www.nabble.com/Form-Based-Authentication-and-URL-tf3758222.html#a10621968
Sent from the MyFaces - Users mailing list archive at Nabble.com.



Re: MyFaces and Security

2007-05-15 Thread Petr Kotek

Hi Rudi,

I am only begginer in JSF and I don't now if exisist better way to 
handle login but next code may help You.


PhaseListener
---
public class LoginPhaseListener implements PhaseListener {
 private final String LOGIN_SOURCE = "loginButton";
 private final String METHOD_GET = "GET";
 private final String MAIN_PAGE = "main.jsp";
 private final String LOGIN_PAGE = "index.jsp";

 public LoginPhaseListener() {
 }

 public PhaseId getPhaseId() {
   return PhaseId.RESTORE_VIEW;
 }

 public void beforePhase(PhaseEvent phaseEvent) {
 }

 public void afterPhase(PhaseEvent phaseEvent) {
   FacesContextctx;
   ExternalContext ex;
   JSFSession session;
   HttpServletRequest hsrq;
   String login;
   String password;
   HttpServletResponse hrsp;
  
   ctx = phaseEvent.getFacesContext();
   session = 
(JSFSession)ctx.getApplication().createValueBinding("#{JSFSession}").getValue(ctx);

   if (!session.isLogged()) {
 ex = ctx.getExternalContext();
 try {
   hsrq = (HttpServletRequest)ex.getRequest();
   // If source is loginButton, then try doLogin
   if (LOGIN_SOURCE.equalsIgnoreCase(hsrq.getParameter("source"))) {
 // Get ifo from login page
 login = hsrq.getParameter("login");
 password = hsrq.getParameter("password");
 // Check it
 if ((login == null) || (password == null) || (login.length() 
== 0) || (password.length() == 0))  {
   ctx.addMessage(null, new 
FacesMessage(FacesMessage.SEVERITY_ERROR, "Login or Password can't be 
empty!", null));

 } else if (session.doLogin(login, password)) {
   if (METHOD_GET.equalsIgnoreCase(hsrq.getMethod())) {
 // Special login (for debug app - autologin) from request 
parameters (?source=loginButton&login=name&password=psw) - redirect to 
main.jsp

 ex.redirect(MAIN_PAGE);
   }
 } else {
   ctx.addMessage(null, new 
FacesMessage(FacesMessage.SEVERITY_ERROR, "Bad Login or Password!", null));

 }
   } else if (hsrq.getRequestURI().indexOf(LOGIN_PAGE) < 0) {
 ctx.addMessage(null, new 
FacesMessage(FacesMessage.SEVERITY_ERROR, "Session Logged Out or 
Expired!", null));

 ex.redirect(LOGIN_PAGE);
   }
 } catch (Exception e) {
   e.printStackTrace();
   ctx.addMessage(null, new 
FacesMessage(FacesMessage.SEVERITY_ERROR, "Unexpected login error!", 
e.getMessage()));

   try {
 ex.redirect(LOGIN_PAGE);
   } catch (IOException f) {;}
 }
   }
 }
}
---
Navigation Handler
---
public class LoginNavigationHandler extends NavigationHandler {
 private final NavigationHandler deflNavHandler;   // Original handler

 public LoginNavigationHandler(NavigationHandler navHandler) {
   super();
   deflNavHandler = navHandler;
 }

 public void handleNavigation(FacesContext facesContext, String 
fromAction, String outcome) {

   JSFSession session;
   try  {
 session = 
(JSFSession)facesContext.getApplication().createValueBinding("#{JSFSession}").getValue(facesContext);

 if (!session.isLogged())  {
   outcome = "logout";
 }
   } catch (Exception ex)  {
 ex.printStackTrace();
   } finally  {
 deflNavHandler.handleNavigation(facesContext, fromAction, outcome);
   }
 }
}
---


Where JSFSession is session bean with boolean .isLogged() and boolean 
.doLogin(login, password) methods. Actually I checked login/password 
against database table with valid users.


Petr



Rudi Steiner wrote:

Hi Veit,

I don't use spring, so I can't use this mechanism :(

Is there a possibility to get the action to call over the facesContext?

thanks,
Rudi

On 5/15/07, Walter Oliver (BR/ICI3) <[EMAIL PROTECTED]> 
wrote:

Frau Nolte wird heute abend 16:30 erste Testbestellungen absenden.

Kunden können ebenso bereits bestellen.

Gruss Oliver Walter

> -Ursprüngliche Nachricht-
> Von: Veit Guna [mailto:[EMAIL PROTECTED]
> Gesendet: Dienstag, 15. Mai 2007 12:11
> An: MyFaces Discussion
> Betreff: Re: MyFaces and Security
>
> I didn't follow the whole thread, but isn't acegi (if you use
> spring) a solution? I use it to protect specific url's as
> well es method invocations on backing beans. Works fine for
> me (but I'm using spring). I must also admit, that I'm using
> jsf-spring to let spring create the backing beans for me (and
> thus let acegi take over security).
>
> /Veit
>
>
>  Original-Nachricht 
> Datum: Tue, 15 May 2007 12:03:21 +0200
> Von: "Rudi Steiner" <[EMAIL PROTECTED]>
> An: "MyFaces Discussion" 
> Betreff: Re: MyFaces and Security
>
> > Hi Cagatay,
> >
> > thanks for the hint. This is definitely one step in making
> an jsf-app
> > secure.
> >
> > I would like to increase the security of my app by writing a
> > phaselistener, which checks the action the current request
> is calling
> > and makes sure, that t

Re: h:graphicImage and Servlets

2007-05-15 Thread Mert Çalışkan

An example which I used in HibernateTrace.

http://jsf-comp.svn.sourceforge.net/viewvc/jsf-comp/trunk/HibernateTrace/HibernateTraceComponent/JavaSource/net/sf/jsfcomp/hibernatetrace/util/HTResourceLoaderPhaseListener.java?view=markup


Regards,

Mert..

On 5/15/07, omidh <[EMAIL PROTECTED]> wrote:



Hi all,
I would like to show images in my portlet, which are saved in a Mysql db,
so
I wrote a servlet
which helps to download files from the db. Now I use these servlet to
receive also the Images but
it does not work... does anyone know a solution?

here the way I use it:


generated code: < i m g src="/MileStoneBeta/FileServlet/?file_id=1">

and here the servlet (nothing special):

protected void doGet(HttpServletRequest request,
HttpServletResponse response) throws
ServletException, IOException {

FacesContext fctx = getFacesContext(request, response);

ValueBinding bind = FacesContext.getCurrentInstance
().getApplication()
.createValueBinding("#{facadeService}");
if (bind == null)
logger.fatal("ValueBinding is null");

FacadeService bean = (FacadeService) bind.getValue(fctx);


Integer fileId = Integer.parseInt(request.getParameter
("file_id"));

UFile file =
(UFile)bean.getMileStoneService().getEntryManager().loadById(UFile.class,
fileId);
logger.debug("file="+file);
if(file != null){
response.setContentType(file.getContentType());
response.setContentLength(file.getContent
().length);
response.setHeader("Content-Disposition",
"attachement; filename=\"" +
file.getFileName() + "\"");
if(logger.isDebugEnabled())
logger.debug("sending file ...");
response.getOutputStream().write(file.getContent
());
response.flushBuffer();
}

}

or is there a simple way to do it? ;)

thanks in advance,
Omid
--
View this message in context:
http://www.nabble.com/h%3AgraphicImage-and-Servlets-tf3757832.html#a10620803
Sent from the MyFaces - Users mailing list archive at Nabble.com.




Re: MyFaces and Security

2007-05-15 Thread Rudi Steiner

Hi Veit,

I don't use spring, so I can't use this mechanism :(

Is there a possibility to get the action to call over the facesContext?

thanks,
Rudi

On 5/15/07, Walter Oliver (BR/ICI3) <[EMAIL PROTECTED]> wrote:

Frau Nolte wird heute abend 16:30 erste Testbestellungen absenden.

Kunden können ebenso bereits bestellen.

Gruss Oliver Walter

> -Ursprüngliche Nachricht-
> Von: Veit Guna [mailto:[EMAIL PROTECTED]
> Gesendet: Dienstag, 15. Mai 2007 12:11
> An: MyFaces Discussion
> Betreff: Re: MyFaces and Security
>
> I didn't follow the whole thread, but isn't acegi (if you use
> spring) a solution? I use it to protect specific url's as
> well es method invocations on backing beans. Works fine for
> me (but I'm using spring). I must also admit, that I'm using
> jsf-spring to let spring create the backing beans for me (and
> thus let acegi take over security).
>
> /Veit
>
>
>  Original-Nachricht 
> Datum: Tue, 15 May 2007 12:03:21 +0200
> Von: "Rudi Steiner" <[EMAIL PROTECTED]>
> An: "MyFaces Discussion" 
> Betreff: Re: MyFaces and Security
>
> > Hi Cagatay,
> >
> > thanks for the hint. This is definitely one step in making
> an jsf-app
> > secure.
> >
> > I would like to increase the security of my app by writing a
> > phaselistener, which checks the action the current request
> is calling
> > and makes sure, that the current user has the right to call this
> > action (example calling the method deleteUser() in a backingbean).
> >
> > Could anyone please tell me, how I can determine in a phaselistener
> > which action is going to be called in the current request?
> >
> > best regards,
> > Rudi
> >
> > On 5/14/07, Cagatay Civici <[EMAIL PROTECTED]> wrote:
> > > Hi,
> > >
> > >  Regarding your concerns about the viewstate at client;
> > >
> > >  http://wiki.apache.org/myfaces/Secure_Your_Application
> > >
> > >  Cagatay
> > >
> > >
> > > On 5/14/07, Rudi Steiner <[EMAIL PROTECTED]> wrote:
> > > > Hello,
> > > >
> > > > I'm in the final state of a project and thinking about,
> which is the
> > > > best way to make a myFaces-App secure (authentication,
> authorization,
> > > > ...)
> > > >
> > > > I'm thinking about the Tomcat build in mechanism or an
> alternative
> > > > like securityFilter. But thinking about it, I got some
> questions like,
> > > > how about to fake the view state on the client side.
> > > >
> > > > Could It be, that for example a normal user who knows the
> > > > applicationcode, fakes the viewstate on the client for
> a page which
> > > > has for example some commandbuttons which are rendered
> for an admin
> > > > but are not rendered for a normal user? Has anyone made
> experiences in
> > > > this area?
> > > >
> > > > thanks a lot,
> > > > Rudi
> > > >
> > >
> > >
>
> --
> GMX FreeMail: 1 GB Postfach, 5 E-Mail-Adressen, 10 Free SMS.
> Alle Infos und kostenlose Anmeldung: http://www.gmx.net/de/go/freemail
>



Re: h:graphicImage and Servlets

2007-05-15 Thread Cagatay Civici

Hi,

Instead of a servlet, you may use a phaselistener instead which fits better
in portlet environment.

Here's an example;

http://www.jroller.com/page/cagataycivici?entry=phaselistener_renders_an_image_no

Regards,

Cagatay

On 5/15/07, omidh <[EMAIL PROTECTED]> wrote:



Hi all,
I would like to show images in my portlet, which are saved in a Mysql db,
so
I wrote a servlet
which helps to download files from the db. Now I use these servlet to
receive also the Images but
it does not work... does anyone know a solution?

here the way I use it:


generated code: < i m g src="/MileStoneBeta/FileServlet/?file_id=1">

and here the servlet (nothing special):

protected void doGet(HttpServletRequest request,
HttpServletResponse response) throws
ServletException, IOException {

FacesContext fctx = getFacesContext(request, response);

ValueBinding bind = FacesContext.getCurrentInstance
().getApplication()
.createValueBinding("#{facadeService}");
if (bind == null)
logger.fatal("ValueBinding is null");

FacadeService bean = (FacadeService) bind.getValue(fctx);


Integer fileId = Integer.parseInt(request.getParameter
("file_id"));

UFile file =
(UFile)bean.getMileStoneService().getEntryManager().loadById(UFile.class,
fileId);
logger.debug("file="+file);
if(file != null){
response.setContentType(file.getContentType());
response.setContentLength(file.getContent
().length);
response.setHeader("Content-Disposition",
"attachement; filename=\"" +
file.getFileName() + "\"");
if(logger.isDebugEnabled())
logger.debug("sending file ...");
response.getOutputStream().write(file.getContent
());
response.flushBuffer();
}

}

or is there a simple way to do it? ;)

thanks in advance,
Omid
--
View this message in context:
http://www.nabble.com/h%3AgraphicImage-and-Servlets-tf3757832.html#a10620803
Sent from the MyFaces - Users mailing list archive at Nabble.com.




h:graphicImage and Servlets

2007-05-15 Thread omidh

Hi all,
I would like to show images in my portlet, which are saved in a Mysql db, so
I wrote a servlet
which helps to download files from the db. Now I use these servlet to
receive also the Images but 
it does not work... does anyone know a solution?

here the way I use it:


generated code: < i m g src="/MileStoneBeta/FileServlet/?file_id=1">

and here the servlet (nothing special):

protected void doGet(HttpServletRequest request,
HttpServletResponse response) throws ServletException, 
IOException {

FacesContext fctx = getFacesContext(request, response);

ValueBinding bind = 
FacesContext.getCurrentInstance().getApplication()
.createValueBinding("#{facadeService}");
if (bind == null)
logger.fatal("ValueBinding is null");

FacadeService bean = (FacadeService) bind.getValue(fctx);


Integer fileId = 
Integer.parseInt(request.getParameter("file_id"));

UFile file =
(UFile)bean.getMileStoneService().getEntryManager().loadById(UFile.class,
fileId);
logger.debug("file="+file);
if(file != null){
response.setContentType(file.getContentType());
response.setContentLength(file.getContent().length);
response.setHeader("Content-Disposition", "attachement; 
filename=\"" + 
file.getFileName() + "\"");
if(logger.isDebugEnabled())
logger.debug("sending file ...");
response.getOutputStream().write(file.getContent());
response.flushBuffer();
}

}

or is there a simple way to do it? ;)

thanks in advance,
Omid
-- 
View this message in context: 
http://www.nabble.com/h%3AgraphicImage-and-Servlets-tf3757832.html#a10620803
Sent from the MyFaces - Users mailing list archive at Nabble.com.



Rückruf: MyFaces and Security

2007-05-15 Thread Walter Oliver (BR/ICI3)
Walter Oliver (BR/ICI3) möchte die Nachricht "MyFaces and Security" zurückrufen.


AW: MyFaces and Security

2007-05-15 Thread Walter Oliver (BR/ICI3)
Frau Nolte wird heute abend 16:30 erste Testbestellungen absenden.

Kunden können ebenso bereits bestellen.

Gruss Oliver Walter

> -Ursprüngliche Nachricht-
> Von: Veit Guna [mailto:[EMAIL PROTECTED] 
> Gesendet: Dienstag, 15. Mai 2007 12:11
> An: MyFaces Discussion
> Betreff: Re: MyFaces and Security
> 
> I didn't follow the whole thread, but isn't acegi (if you use 
> spring) a solution? I use it to protect specific url's as 
> well es method invocations on backing beans. Works fine for 
> me (but I'm using spring). I must also admit, that I'm using 
> jsf-spring to let spring create the backing beans for me (and 
> thus let acegi take over security).
> 
> /Veit
> 
> 
>  Original-Nachricht 
> Datum: Tue, 15 May 2007 12:03:21 +0200
> Von: "Rudi Steiner" <[EMAIL PROTECTED]>
> An: "MyFaces Discussion" 
> Betreff: Re: MyFaces and Security
> 
> > Hi Cagatay,
> > 
> > thanks for the hint. This is definitely one step in making 
> an jsf-app
> > secure.
> > 
> > I would like to increase the security of my app by writing a
> > phaselistener, which checks the action the current request 
> is calling
> > and makes sure, that the current user has the right to call this
> > action (example calling the method deleteUser() in a backingbean).
> > 
> > Could anyone please tell me, how I can determine in a phaselistener
> > which action is going to be called in the current request?
> > 
> > best regards,
> > Rudi
> > 
> > On 5/14/07, Cagatay Civici <[EMAIL PROTECTED]> wrote:
> > > Hi,
> > >
> > >  Regarding your concerns about the viewstate at client;
> > >
> > >  http://wiki.apache.org/myfaces/Secure_Your_Application
> > >
> > >  Cagatay
> > >
> > >
> > > On 5/14/07, Rudi Steiner <[EMAIL PROTECTED]> wrote:
> > > > Hello,
> > > >
> > > > I'm in the final state of a project and thinking about, 
> which is the
> > > > best way to make a myFaces-App secure (authentication, 
> authorization,
> > > > ...)
> > > >
> > > > I'm thinking about the Tomcat build in mechanism or an 
> alternative
> > > > like securityFilter. But thinking about it, I got some 
> questions like,
> > > > how about to fake the view state on the client side.
> > > >
> > > > Could It be, that for example a normal user who knows the
> > > > applicationcode, fakes the viewstate on the client for 
> a page which
> > > > has for example some commandbuttons which are rendered 
> for an admin
> > > > but are not rendered for a normal user? Has anyone made 
> experiences in
> > > > this area?
> > > >
> > > > thanks a lot,
> > > > Rudi
> > > >
> > >
> > >
> 
> -- 
> GMX FreeMail: 1 GB Postfach, 5 E-Mail-Adressen, 10 Free SMS.
> Alle Infos und kostenlose Anmeldung: http://www.gmx.net/de/go/freemail
> 


t:radio in combination with t:selectItems

2007-05-15 Thread Beelen, Marco
Hello all,

In the application I'm currently working one, I want to start using the
t:selectOneRadio with the spread-layout and use t:radio to position the
radioButtons on the screen.
The selectItems for this selectOneRadio are being created by using
t:selectItems.

The code of the page look like this:
















When I try to open the page on which this code is placed I get an error:

java.lang.IndexOutOfBoundsException: index 0 >= 0
at
org.apache.myfaces.renderkit.html.ext.HtmlRadioRenderer.renderRadio(Html
RadioRenderer.java:111)
at
org.apache.myfaces.renderkit.html.ext.HtmlRadioRenderer.encodeEnd(HtmlRa
dioRenderer.java:59)
at
javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:539
)
at
com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSuppo
rt.java:252)
at
com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSuppo
rt.java:249)
at
com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSuppo
rt.java:249)
at
com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSuppo
rt.java:249)
at
com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSuppo
rt.java:249)
at
com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:5
73)



I'm sure the metthod getAvailableNewStatusses() return a array of the
size 2 containing the statusses needed for the selectItems. (The status
are java enums and the getter returns the enum.values() )

I started to wonder if I can use t:radio in combination with
t:selectItems.

Did anybody try this already and got it working?

If so: any suggestions on what I might be doing wrong?
If you know this won't work: Any suggestions for a different approach?

Any suggestions are greatly appreciated.

With kind regards and thanks in advance for your time and effort,
Marco Beelen



--
Notice:  This e-mail message, together with any attachments, contains
information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station,
New Jersey, USA 08889), and/or its affiliates (which may be known
outside the United States as Merck Frosst, Merck Sharp & Dohme or MSD
and in Japan, as Banyu - direct contact information for affiliates is 
available at http://www.merck.com/contact/contacts.html) that may be 
confidential, proprietary copyrighted and/or legally privileged. It is 
intended solely for the use of the individual or entity named on this 
message. If you are not the intended recipient, and have received this 
message in error, please notify us immediately by reply e-mail and then 
delete it from your system.

--

Re: MyFaces and Security

2007-05-15 Thread Veit Guna
I didn't follow the whole thread, but isn't acegi (if you use spring) a 
solution? I use it to protect specific url's as well es method invocations on 
backing beans. Works fine for me (but I'm using spring). I must also admit, 
that I'm using jsf-spring to let spring create the backing beans for me (and 
thus let acegi take over security).

/Veit


 Original-Nachricht 
Datum: Tue, 15 May 2007 12:03:21 +0200
Von: "Rudi Steiner" <[EMAIL PROTECTED]>
An: "MyFaces Discussion" 
Betreff: Re: MyFaces and Security

> Hi Cagatay,
> 
> thanks for the hint. This is definitely one step in making an jsf-app
> secure.
> 
> I would like to increase the security of my app by writing a
> phaselistener, which checks the action the current request is calling
> and makes sure, that the current user has the right to call this
> action (example calling the method deleteUser() in a backingbean).
> 
> Could anyone please tell me, how I can determine in a phaselistener
> which action is going to be called in the current request?
> 
> best regards,
> Rudi
> 
> On 5/14/07, Cagatay Civici <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> >  Regarding your concerns about the viewstate at client;
> >
> >  http://wiki.apache.org/myfaces/Secure_Your_Application
> >
> >  Cagatay
> >
> >
> > On 5/14/07, Rudi Steiner <[EMAIL PROTECTED]> wrote:
> > > Hello,
> > >
> > > I'm in the final state of a project and thinking about, which is the
> > > best way to make a myFaces-App secure (authentication, authorization,
> > > ...)
> > >
> > > I'm thinking about the Tomcat build in mechanism or an alternative
> > > like securityFilter. But thinking about it, I got some questions like,
> > > how about to fake the view state on the client side.
> > >
> > > Could It be, that for example a normal user who knows the
> > > applicationcode, fakes the viewstate on the client for a page which
> > > has for example some commandbuttons which are rendered for an admin
> > > but are not rendered for a normal user? Has anyone made experiences in
> > > this area?
> > >
> > > thanks a lot,
> > > Rudi
> > >
> >
> >

-- 
GMX FreeMail: 1 GB Postfach, 5 E-Mail-Adressen, 10 Free SMS.
Alle Infos und kostenlose Anmeldung: http://www.gmx.net/de/go/freemail


Re: MyFaces and Security

2007-05-15 Thread Rudi Steiner

Hi Cagatay,

thanks for the hint. This is definitely one step in making an jsf-app secure.

I would like to increase the security of my app by writing a
phaselistener, which checks the action the current request is calling
and makes sure, that the current user has the right to call this
action (example calling the method deleteUser() in a backingbean).

Could anyone please tell me, how I can determine in a phaselistener
which action is going to be called in the current request?

best regards,
Rudi

On 5/14/07, Cagatay Civici <[EMAIL PROTECTED]> wrote:

Hi,

 Regarding your concerns about the viewstate at client;

 http://wiki.apache.org/myfaces/Secure_Your_Application

 Cagatay


On 5/14/07, Rudi Steiner <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I'm in the final state of a project and thinking about, which is the
> best way to make a myFaces-App secure (authentication, authorization,
> ...)
>
> I'm thinking about the Tomcat build in mechanism or an alternative
> like securityFilter. But thinking about it, I got some questions like,
> how about to fake the view state on the client side.
>
> Could It be, that for example a normal user who knows the
> applicationcode, fakes the viewstate on the client for a page which
> has for example some commandbuttons which are rendered for an admin
> but are not rendered for a normal user? Has anyone made experiences in
> this area?
>
> thanks a lot,
> Rudi
>




t:dataScroller: paginator table missing!

2007-05-15 Thread Marcus Beyer


To whom it may concern,

I am using a tomahawk dataScroller together with a tomahawk  
dataTable. Nice.


Then I updated from myFaces 1.1.4 + Tomahawk 1.1.3 to both 1.1.5.

After that update the  around the paginator is missing.
The paginators  elements are there,
but directly besides the other  elements (first, previous, etc).  
Consequently

paginatorTableClass is not used at all.  Any idea?

My code:

 rows="# 
{pagePointer.currentSearchHandler.numberOfProjectsPerPage}"

 sortColumn="#{projectListHandler.sortColumn}"
 sortAscending="#{projectListHandler.sortAscending}"
 preserveDataModel="true"
 preserveSort="true"
 styleClass="projectList"
 rowClasses="light,dark"
 columnClasses=",,number,date"
 headerClass="header">

…






  
  

  
…



Please help!

respectfully
Marcus



dataScroller, ListDataModel and saveState

2007-05-15 Thread Walter Oliver (BR/ICI3)
Hello all,

i have trouble to get a dataTable with dataScroller to work.

I have a ManagedBean wich get a result from search in database.

code:

public class SearchBean {

List result;

public void validateSearch(FacesContext context,
UIComponent componentToValidate, Object value)
throws ValidatorException {


result = SearchDAO.findByName(value.toString());

if(result.isEmpty()){
FacesMessage message = new FacesMessage(
"No result found with name " +
value.toString()+ "!");
throw new ValidatorException(message);
}
}

public List getResult() {
return this.result;
}
}

If i configure the the bean in request scope, the 1. page looks
fine (rows 1-10 from e.g. 30), but if paginate or forward to the 
next page, result is empty.

I found out this is normal behaviour with JSF and request scope, so no
matter
and i changed the scope to session. With that configured everything
works well.

But on http://wiki.apache.org/myfaces/FAQ i found the follwing info:

"t:saveState is preffered over a session scoped solution."

As well i don`t need the whole result the whole session in memory.

What i did now is:
added  in
result.jsp 
added "implements Serializable" to SearchBean and 
set scope back to "request". 

But now i get the exception:

62001 [http-8080-Processor24] ERROR
org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlTableRendererBase
- Row is not available. Rowindex = 0
65135 [http-8080-Processor24] ERROR
org.apache.myfaces.lifecycle.PhaseListenerManager  - Exception in
PhaseListener RESTORE_VIEW(1) afterPhase
java.lang.NullPointerException
at
org.apache.myfaces.renderkit.html.util.AutoScrollPhaseListener.afterPhas
e(AutoScrollPhaseListener.java:52)

...
javax.faces.el.PropertyNotFoundException: Bean:
com.jmangos.beans.SearchBean, property: result
at
org.apache.myfaces.el.PropertyResolverImpl.setProperty(PropertyResolverI
mpl.java:391)


What did next was to wrap result in ListDataModel, but the i get
java.io.NotSerializeableException: ListDataModel.

Does anybody know a good tutorial, on how to work with dataTable and
dataScroller on request scoped beans?

How can i use saveState on result?


Regards Oliver







RE: [ANNOUNCE] MyFaces Core v1.1.5 Release

2007-05-15 Thread Jesse Alexander \(KSFD 121\)
Hi

Just checked that page... And I think there is a slight error... 

In the table named "The ASF have licensed the following TCKs:"
JSR-127 : JavaServer Faces  1.2_03  5-Dec-2006

to seems wrong...

JSR-127 is JSF 1.1
JSR-252 would be JSF 1.2

regards
Alexander

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of
Matthias Wessendorf
Sent: Monday, May 14, 2007 6:47 PM
To: MyFaces Discussion
Subject: Re: [ANNOUNCE] MyFaces Core v1.1.5 Release

We should list this release here:

http://apache.org/jcp/

-M

On 2/19/07, Manfred Geiler <[EMAIL PROTECTED]> wrote:
> The Apache MyFaces team is pleased to announce the release of MyFaces
> Core 1.1.5.
>
> MyFaces Core is a JavaServer(tm) Faces 1.1 implementation as specified
> by JSR-127.  MyFaces Core has passed Sun's JSR-127 TCK and is 100%
> compliant with the JSR-127 specification.
>
> MyFaces Core 1.1.5 is available in both binary and source
distributions.
>
> * http://myfaces.apache.org/download.html
>
> MyFaces Core is also available in the central Maven repository under
> Group ID "org.apache.myfaces.core".
>
> Release Notes - MyFaces Core - Version 1.1.5
>  ** Fixed Bugs
> * [MYFACES-437] -  does not work  with  
> * [MYFACES-660] - (Patch provided) "request scoping" from Portlet
> Action- to RenderRequest should not occur via Attribute Request Map
> * [MYFACES-689] - PropertyResolverImpl.getType(Object base, int
> index) return null if base instanceof Object[]
> * [MYFACES-731] - selectManyListbox calls converter getAsString
> passing in string value during form post
> * [MYFACES-828] - HtmlCheckboxRenderer ignores readonly
> * [MYFACES-968] - LifecycleImpl's restoreView throws NPE when
> viewId is null in a portlet context
> * [MYFACES-1025] - panelGrid does always render a border-attribute
> * [MYFACES-1029] - Duplicate sibling ids allowed
> * [MYFACES-1304] - DigesterFacesConfigDispenserImpl shuld respect
> order of registered renderkits
> * [MYFACES-1328] - UISelectOne and UISelectMany fail with custom
> converter that returns java.lang.String from getAsObject() method.
> * [MYFACES-1368] - Fix case sensitivity for context params
> * [MYFACES-1384] - After switch from myfaces-impl-1.1.3 (release)
> to myfaces-1.1.5-SNAPSHOT, javascript throw error 'Object expected'
> * [MYFACES-1386] - PropertyResolverImpl.setProperty lacks usefull
> error mesage if write method not found
> * [MYFACES-1393] - MyFaces state information is rendered by
MyFaces Form
> * [MYFACES-1397] - getValidJavascriptNameAsInRI throws
> java.lang.IllegalArgumentException: Illegal group reference
> * [MYFACES-1406] - Core and Shared project has dependency on
> myfaces:myfaces-api version 1.1.1
> * [MYFACES-1407] - JS oamSubmitForm() params order incorrect
> * [MYFACES-1410] - CLONE -PropertyResolverImpl.getType(Object
> base, int index) return null if base instanceof Object[]
> * [MYFACES-1412] - Restore view phase does not conforms
specification
> * [MYFACES-1413] - JS error in function oamSubmitForm(...)
> * [MYFACES-1415] - WebXmlParser needs to be aware of changes in
> web.xml in version 2.4 of the Servlet spec
> * [MYFACES-1420] - Null Pointer Exception in
> SelectItemsIterator.next() if binding is null
> * [MYFACES-1421] - MyFaces not working with Struts Faces Form
> * [MYFACES-1425] - wrong text for link in getting started
> * [MYFACES-1427] - Error restoring view
> * [MYFACES-1428] - Application cannot be started with Snapshot
> 1.1.5 of 27th Sept./1st Oct.
> * [MYFACES-1430] - selectOneMenu looses values after clicking
> immediate link (since 1.1.4)
> * [MYFACES-1479] - SerialFactory breaks Portlet bridge
> * [MYFACES-1481] - MyFacesGenericPortlet does not work in a
cluster
> * [MYFACES-1486] - Error Handling in Property-Resolver-Impl
> * [MYFACES-1489] - ExternalContext Maps
> * [MYFACES-1490] - DateTimeConverter exception on parsing time
> * [MYFACES-1495] - client side state saving bug
> * [MYFACES-1500] - Default values in standard-faces-config.xml
> * [MYFACES-1510] - h:form does not render accept-charset
>  ** Improvements
> * [MYFACES-652] - Findbugs ant-tasks
> * [MYFACES-1032] - use a javascript method in commondLink for
> lesser html size
> * [MYFACES-1366] - Error in javascript function
> * [MYFACES-1373] - Add exception to logger for output exception
stack trace
> * [MYFACES-1385] - Remove all of the unused code, variables, and
> import statements identified by Eclipse 3.1.2
> * [MYFACES-1405] - Interoperability with Facelets
> * [MYFACES-1411] - Lifecycle phase executions repetitions
> * [MYFACES-1418] - javax.faces.validator - DoubleRangeValidator,
> LengthValidator, LongRangeValidator are very similar, refactor common
> behaviour
> * [MYFACES-1419] - javax.faces.convert - refactor common behaviour
> + DateTimeConverter changes
> * [MYFACES-

AW: JSF, Tomcat memory usage

2007-05-15 Thread Pfau, Oliver
I set the object from a portlet and open the PDF byte[] in a non-portlet
jsp. The only way it worked by now was to set the object in portlet
application scope and read it in the jsp with session.getAttribute(...)



Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Gesendet: Montag, 14. Mai 2007 17:45
An: MyFaces Discussion
Betreff: Re: JSF, Tomcat memory usage



Why are you storing such a large object in session scope in the first
place? What's wrong with a different scope? 





"Andrew Robinson" <[EMAIL PROTECTED]> 

05/14/2007 10:52 AM 
Please respond to
"MyFaces Discussion" 


To
"MyFaces Discussion"  
cc
Subject
Re: JSF, Tomcat memory usage






The memory will not go away until the GC decides to clean up the
objects. You may want to try to force a GC for testing reasons and see
if that shows that it is working fine (then you can remove the call to
GC as you should never call it directly)

On 5/14/07, Pfau, Oliver <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I have made some test with my JSF portlet regarding memory consumption
> with liferay and tomcat. The memory usage increases up to 1,1 Gbyte.
> After closing the session and waiting, the memory usage does not
> decrease.
> In detail I store a big PDF as byte[] in the session, show it and
remove
> it from the session but the memory usage remains on the highest value.
> That's strange I think.
>
>


_

CONFIDENTIALITY NOTICE

The information contained in this e-mail message is intended only for
the exclusive use of the individual or entity named above and may
contain information that is privileged, confidential or exempt from
disclosure under applicable law. If the reader of this message is not
the intended recipient, or the employee or agent responsible for
delivery of the message to the intended recipient, you are hereby
notified that any dissemination, distribution or copying of this
communication is strictly prohibited. If you have received this
communication in error, please notify the sender immediately by e-mail
and delete the material from any computer.  Thank you.