You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by Legolas Woodland <le...@gmail.com> on 2006/01/23 00:51:02 UTC

a problem with servlet url mapping , a complex problem for mapping servlet to fit portal url prefix.

a problem with servlet url mapping ,  a complex problem.

Hi
Thank you for reading my post.
My problem is about using a Chart library which works well in jsf
application
but it does not works in JSF portlets.
I think i find the problem but i do not know the solution.
to use this charting library we should add a servlet to web.xml

something like :
[code]

  <servlet>
    <servlet-name>Jenia internal servlet</servlet-name>
    <servlet-class>org.jenia.faces.util.Servlet</servlet-class>
    <load-on-startup>2</load-on-startup>
</servlet>
<servlet-mapping>
    <servlet-name>Jenia internal servlet</servlet-name>
    <url-pattern>/jenia4faces/*</url-pattern>
</servlet-mapping>

[/code]


so , when we try to load a chart , it will make the chart image source
something like :

http://localhost:28080/Adv/jenia4faces/chart/OAReport.jspBarChart3d_id0.png


in the above sample , adv is the name of web application which is
deployed in a servlet container.
and filter applied to make the chart render-able.


[b]to use the chart library in jsf portlet , i add the servlet
description as i did for web application , so i add[/b]

[code]

  <servlet>
    <servlet-name>Jenia internal servlet</servlet-name>
    <servlet-class>org.jenia.faces.util.Servlet</servlet-class>
    <load-on-startup>2</load-on-startup>
</servlet>
<servlet-mapping>
    <servlet-name>Jenia internal servlet</servlet-name>
    <url-pattern>/jenia4faces/*</url-pattern>
</servlet-mapping>

[/code]

to my portlet web.xml file.

when we have portlet , the url to access that portlet (which indeed is a
web application) changes
for example url for a sample portlet with same web application name
will be like
http://localhost:28080/pluto/portal/Adv/

as you can see there are some prefix to web application name in the url
, but when i use chart component to show
same chart , it still look for the chart in url like :

http://localhost:28080/Adv/jenia4faces/chart/OAReport.jspBarChart3d_id0.png


As you may already sugest , the image will not render because browser is
looking in  wrong place.
now i think if i find some way to map that servlet to correct url
pattern it will works.

my question is :
1-what will be new servlet url pattern ?
2-is my assumption correct ?


Thank you very much for reading such a long post


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: a problem with servlet url mapping , a complex problem for mapping servlet to fit portal url prefix.

Posted by David Sean Taylor <da...@bluesunrise.com>.
Legolas Woodland wrote:
> Thank you for reply.
> right now i have created the portlet and its final steps is to add some 
> Charts.
> My only way is to make charts working otherwise everything will go mad 
> against me.
> 
> as you can see i tried to deploy the portlet on Pluto using JSF-portlet 
> bridge.
> is there other option for me to make chart working ?
> 
Sounds to me like you are using Jenia 4 Faces
http://www.jenia.org/jsp/home.jsf
Is that correct?

If yes, then why not use the Apache Portals JSF Bridge?

http://portals.apache.org/bridges/multiproject/portals-bridges-jsf/index.html

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: a problem with servlet url mapping , a complex problem for mapping servlet to fit portal url prefix.

Posted by Legolas Woodland <le...@gmail.com>.
Thank you for reply.
right now i have created the portlet and its final steps is to add some 
Charts.
My only way is to make charts working otherwise everything will go mad 
against me.

as you can see i tried to deploy the portlet on Pluto using JSF-portlet 
bridge.
is there other option for me to make chart working ?


David Sean Taylor wrote:
> Legolas Woodland wrote:
>> a problem with servlet url mapping ,  a complex problem.
>>
>> Hi
>> Thank you for reading my post.
>> My problem is about using a Chart library which works well in jsf
>> application
>> but it does not works in JSF portlets.
>> I think i find the problem but i do not know the solution.
>> to use this charting library we should add a servlet to web.xml
>>
>> something like :
>> [code]
>>
>>  <servlet>
>>    <servlet-name>Jenia internal servlet</servlet-name>
>>    <servlet-class>org.jenia.faces.util.Servlet</servlet-class>
>>    <load-on-startup>2</load-on-startup>
>> </servlet>
>> <servlet-mapping>
>>    <servlet-name>Jenia internal servlet</servlet-name>
>>    <url-pattern>/jenia4faces/*</url-pattern>
>> </servlet-mapping>
>>
>> [/code]
>>
>>
>> so , when we try to load a chart , it will make the chart image source
>> something like :
>>
>> http://localhost:28080/Adv/jenia4faces/chart/OAReport.jspBarChart3d_id0.png 
>>
>>
>>
>> in the above sample , adv is the name of web application which is
>> deployed in a servlet container.
>> and filter applied to make the chart render-able.
>>
>>
>> [b]to use the chart library in jsf portlet , i add the servlet
>> description as i did for web application , so i add[/b]
>>
>> [code]
>>
>>  <servlet>
>>    <servlet-name>Jenia internal servlet</servlet-name>
>>    <servlet-class>org.jenia.faces.util.Servlet</servlet-class>
>>    <load-on-startup>2</load-on-startup>
>> </servlet>
>> <servlet-mapping>
>>    <servlet-name>Jenia internal servlet</servlet-name>
>>    <url-pattern>/jenia4faces/*</url-pattern>
>> </servlet-mapping>
>>
>> [/code]
>>
>> to my portlet web.xml file.
>>
>> when we have portlet , the url to access that portlet (which indeed is a
>> web application) changes
>> for example url for a sample portlet with same web application name
>> will be like
>> http://localhost:28080/pluto/portal/Adv/
>>
>> as you can see there are some prefix to web application name in the url
>> , but when i use chart component to show
>> same chart , it still look for the chart in url like :
>>
>> http://localhost:28080/Adv/jenia4faces/chart/OAReport.jspBarChart3d_id0.png 
>>
>>
>>
>> As you may already sugest , the image will not render because browser is
>> looking in  wrong place.
>> now i think if i find some way to map that servlet to correct url
>> pattern it will works.
>>
>> my question is :
>> 1-what will be new servlet url pattern ?
>> 2-is my assumption correct ?
>>
>>
>> Thank you very much for reading such a long post
>>
>>
> The problem is that portlet URLs always must go back to the portal
> The solution is usually provided by the library, such as with 
> DisplayTags, providing a nice abstraction for URL generation:
>
> http://displaytag.sourceforge.net/11/portlet.html
>
> or, by tools that try to make servlet applications run 'tranparently' 
> in portlets. One such tool is Apache Portals Bridges:
>
> http://portals.apache.org/bridges/
>


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: a problem with servlet url mapping , a complex problem for mapping servlet to fit portal url prefix.

Posted by David Sean Taylor <da...@bluesunrise.com>.
Legolas Woodland wrote:
> a problem with servlet url mapping ,  a complex problem.
> 
> Hi
> Thank you for reading my post.
> My problem is about using a Chart library which works well in jsf
> application
> but it does not works in JSF portlets.
> I think i find the problem but i do not know the solution.
> to use this charting library we should add a servlet to web.xml
> 
> something like :
> [code]
> 
>  <servlet>
>    <servlet-name>Jenia internal servlet</servlet-name>
>    <servlet-class>org.jenia.faces.util.Servlet</servlet-class>
>    <load-on-startup>2</load-on-startup>
> </servlet>
> <servlet-mapping>
>    <servlet-name>Jenia internal servlet</servlet-name>
>    <url-pattern>/jenia4faces/*</url-pattern>
> </servlet-mapping>
> 
> [/code]
> 
> 
> so , when we try to load a chart , it will make the chart image source
> something like :
> 
> http://localhost:28080/Adv/jenia4faces/chart/OAReport.jspBarChart3d_id0.png
> 
> 
> in the above sample , adv is the name of web application which is
> deployed in a servlet container.
> and filter applied to make the chart render-able.
> 
> 
> [b]to use the chart library in jsf portlet , i add the servlet
> description as i did for web application , so i add[/b]
> 
> [code]
> 
>  <servlet>
>    <servlet-name>Jenia internal servlet</servlet-name>
>    <servlet-class>org.jenia.faces.util.Servlet</servlet-class>
>    <load-on-startup>2</load-on-startup>
> </servlet>
> <servlet-mapping>
>    <servlet-name>Jenia internal servlet</servlet-name>
>    <url-pattern>/jenia4faces/*</url-pattern>
> </servlet-mapping>
> 
> [/code]
> 
> to my portlet web.xml file.
> 
> when we have portlet , the url to access that portlet (which indeed is a
> web application) changes
> for example url for a sample portlet with same web application name
> will be like
> http://localhost:28080/pluto/portal/Adv/
> 
> as you can see there are some prefix to web application name in the url
> , but when i use chart component to show
> same chart , it still look for the chart in url like :
> 
> http://localhost:28080/Adv/jenia4faces/chart/OAReport.jspBarChart3d_id0.png
> 
> 
> As you may already sugest , the image will not render because browser is
> looking in  wrong place.
> now i think if i find some way to map that servlet to correct url
> pattern it will works.
> 
> my question is :
> 1-what will be new servlet url pattern ?
> 2-is my assumption correct ?
> 
> 
> Thank you very much for reading such a long post
> 
> 
The problem is that portlet URLs always must go back to the portal
The solution is usually provided by the library, such as with 
DisplayTags, providing a nice abstraction for URL generation:

http://displaytag.sourceforge.net/11/portlet.html

or, by tools that try to make servlet applications run 'tranparently' in 
portlets. One such tool is Apache Portals Bridges:

http://portals.apache.org/bridges/


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org