Apache Struts Bridge and eXo Portal - url rewrite

View: New views
3 Messages — Rating Filter:   Alert me  

Apache Struts Bridge and eXo Portal - url rewrite

by Massimiliano Cuccia :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi all
Im using Apache Struts Bridge to integrate a struts application into exo portal as a portlet.

At now I can see my application's first page into a portlet, this is fine!!

but i have a problem: the taglib for url-rewrite doesn't work!
infact all the link in the application refer to external-to-the-portal destination even if I'm using the struts tags replacements.

i'm using the taglib from the bridge, this is the line that substitute original struts taglib
<%@ taglib uri="http://portals.apache.org/bridges/struts/tags-portlet-html" prefix="html" %>

this is the line that render the link
<html:link action="/TestRegistrazione">Test registrazione</html:link>

this link will refer to http://localhost/Demo/TestRegistrazione.do
but i will expect something like http://localhost/portal/portal/Demo/TestRegistrazione.do

the same happens for the html:form tag destination.

I had done some tests in the jBoss portal obtaining correct and functioning urls into link and form tags!!
Anyone has tested the bridge into eXo Portal?
is there a workaround for the problem i'm experiencing?

thanks

Re: Apache Struts Bridge and eXo Portal - url rewrite

by Massimiliano Cuccia :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Massimiliano Cuccia wrote:
Hi all
Im using Apache Struts Bridge to integrate a struts application into exo portal as a portlet.

At now I can see my application's first page into a portlet, this is fine!!

but i have a problem: the taglib for url-rewrite doesn't work!
infact all the link in the application refer to external-to-the-portal destination even if I'm using the struts tags replacements.

i'm using the taglib from the bridge, this is the line that substitute original struts taglib
<%@ taglib uri="http://portals.apache.org/bridges/struts/tags-portlet-html" prefix="html" %>

this is the line that render the link
<html:link action="/TestRegistrazione">Test registrazione</html:link>

this link will refer to http://localhost/Demo/TestRegistrazione.do
but i will expect something like http://localhost/portal/portal/Demo/TestRegistrazione.do

the same happens for the html:form tag destination.

I had done some tests in the jBoss portal obtaining correct and functioning urls into link and form tags!!
Anyone has tested the bridge into eXo Portal?
is there a workaround for the problem i'm experiencing?

thanks
This is my configuration:

I'm using exo-portal 1.1.4

portals-bridges-struts-0.2.jar
and portal-bridges-common.jar in WEB-INF/lib

and  struts 1.3.5 deployed in common/lib

---------------------------------------------
I have this WEB.XML (portions)
---------------------------------------------

 <listener>
    <listener-class>org.exoplatform.services.portletcontainer.impl.servlet.PortletApplicationListener</listener-class>
  </listener>

  <!-- EXO servlet -->
  <servlet>
    <servlet-name>PortletWrapper</servlet-name>
    <servlet-class>org.exoplatform.services.portletcontainer.impl.servlet.ServletWrapper</servlet-class>
  </servlet>


  <!-- EXO mapping -->
  <servlet-mapping>
    <servlet-name>PortletWrapper</servlet-name>
    <url-pattern>/PortletWrapper</url-pattern>
  </servlet-mapping>

 <servlet>
    <servlet-name>action</servlet-name>
    <servlet-class>org.apache.portals.bridges.struts.PortletServlet</servlet-class>
   ...other stuff...
</servlet>

---------------------------------------------
this is my PORTLET.XML (integral)
---------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>

<portlet-app id="sbridgestrutsportlet"
    xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd" version="1.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd">

  <portlet id="StrutsPortlet">
    <description>DemoRegistrazione</description>
    <portlet-name>DemoRegistrazione</portlet-name>
    <display-name>DemoRegistrazione</display-name>
    <portlet-class>org.apache.portals.bridges.struts.StrutsPortlet</portlet-class>
    <init-param>
      <name>ServletContextProvider</name>
      <value>org.exoplatform.ServletContextProviderImpl</value>
    </init-param>
    <init-param>
      <name>ViewPage</name>
      <value>/view.do</value>
    </init-param>
    <expiration-cache>0</expiration-cache>
    <supports>
      <mime-type>text/html</mime-type>
      <portlet-mode>VIEW</portlet-mode>
    </supports>
    <portlet-info>
      <title>DemoBridge</title>
      <keywords>Struts,demo,bridge</keywords>
    </portlet-info>
  </portlet>

---------------------------------------------
this is my STRUTS-CONFIG.XML (portion)
---------------------------------------------

 <action path="/TestRegistrazione"
                                forward="/pages/registrazioneUtente/register.jsp"/>
 <action path="/registrationAction"
                                type="it.eng.faq.registrazioneUtente.presentation.actions.RegistrationAction"
                                name="registrationBean" >
                        <forward name="success"         path="/registra.do"/>
                        <forward name="error"   path="/view.do"/>
                        <forward name="failure"         path="pannello.errore.screen"/>    
... ... other stuff ... ...
 <controller pagePattern="$P" inputForward="false" processorClass="org.apache.portals.bridges.struts.PortletRequestProcessor"/>

---------------------------------------------
this the jsp file (portion)
---------------------------------------------
<html:link action="/TestRegistrazione">Test registrazione</html:link>
<html:form action="/registrationAction"> ... ... ... </html:form>


the link and the form destination point outside the portal
they point to the application directly

anyone has an idea?
thanks

NB thanks to M. Lecoq that replyed to me directly

Re: Apache Struts Bridge and eXo Portal - url rewrite

by Massimiliano Cuccia :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

no way with that configuration!

but I obtained a working environment using apache struts bridge version 1.0
exo-portal 2.x (compiled version from cvs source, thanks Mr Lecoq)
and correcting following struts-config.xml

thanks again to Mr Lecoq for the help

---------------------------------------------
this is my STRUTS-CONFIG.XML (portion)
---------------------------------------------

 <action path="/TestRegistrazione"
                                forward="/pages/registrazioneUtente/register.jsp"/>
 <action path="/registrationAction"
                                type="it.eng.faq.registrazioneUtente.presentation.actions.RegistrationAction"
                                name="registrationBean" >
                        <forward name="success"         path="/registra.do" redirect="true"/>
                        <forward name="error"   path="/view.do" redirect="true"/>
                        <forward name="failure"         path="pannello.errore.screen" redirect="true"/>    
... ... other stuff ... ...
 <controller pagePattern="$P" inputForward="false" processorClass="org.apache.portals.bridges.struts.PortletRequestProcessor"/>



Massimiliano Cuccia wrote:
Massimiliano Cuccia wrote:
Hi all
Im using Apache Struts Bridge to integrate a struts application into exo portal as a portlet.

At now I can see my application's first page into a portlet, this is fine!!

but i have a problem: the taglib for url-rewrite doesn't work!
infact all the link in the application refer to external-to-the-portal destination even if I'm using the struts tags replacements.

i'm using the taglib from the bridge, this is the line that substitute original struts taglib
<%@ taglib uri="http://portals.apache.org/bridges/struts/tags-portlet-html" prefix="html" %>

this is the line that render the link
<html:link action="/TestRegistrazione">Test registrazione</html:link>

this link will refer to http://localhost/Demo/TestRegistrazione.do
but i will expect something like http://localhost/portal/portal/Demo/TestRegistrazione.do

the same happens for the html:form tag destination.

I had done some tests in the jBoss portal obtaining correct and functioning urls into link and form tags!!
Anyone has tested the bridge into eXo Portal?
is there a workaround for the problem i'm experiencing?

thanks
This is my configuration:

I'm using exo-portal 1.1.4

portals-bridges-struts-0.2.jar
and portal-bridges-common.jar in WEB-INF/lib

and  struts 1.3.5 deployed in common/lib

---------------------------------------------
I have this WEB.XML (portions)
---------------------------------------------

 <listener>
    <listener-class>org.exoplatform.services.portletcontainer.impl.servlet.PortletApplicationListener</listener-class>
  </listener>

  <!-- EXO servlet -->
  <servlet>
    <servlet-name>PortletWrapper</servlet-name>
    <servlet-class>org.exoplatform.services.portletcontainer.impl.servlet.ServletWrapper</servlet-class>
  </servlet>


  <!-- EXO mapping -->
  <servlet-mapping>
    <servlet-name>PortletWrapper</servlet-name>
    <url-pattern>/PortletWrapper</url-pattern>
  </servlet-mapping>

 <servlet>
    <servlet-name>action</servlet-name>
    <servlet-class>org.apache.portals.bridges.struts.PortletServlet</servlet-class>
   ...other stuff...
</servlet>

---------------------------------------------
this is my PORTLET.XML (integral)
---------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>

<portlet-app id="sbridgestrutsportlet"
    xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd" version="1.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd">

  <portlet id="StrutsPortlet">
    <description>DemoRegistrazione</description>
    <portlet-name>DemoRegistrazione</portlet-name>
    <display-name>DemoRegistrazione</display-name>
    <portlet-class>org.apache.portals.bridges.struts.StrutsPortlet</portlet-class>
    <init-param>
      <name>ServletContextProvider</name>
      <value>org.exoplatform.ServletContextProviderImpl</value>
    </init-param>
    <init-param>
      <name>ViewPage</name>
      <value>/view.do</value>
    </init-param>
    <expiration-cache>0</expiration-cache>
    <supports>
      <mime-type>text/html</mime-type>
      <portlet-mode>VIEW</portlet-mode>
    </supports>
    <portlet-info>
      <title>DemoBridge</title>
      <keywords>Struts,demo,bridge</keywords>
    </portlet-info>
  </portlet>

---------------------------------------------
this is my STRUTS-CONFIG.XML (portion)
---------------------------------------------

 <action path="/TestRegistrazione"
                                forward="/pages/registrazioneUtente/register.jsp"/>
 <action path="/registrationAction"
                                type="it.eng.faq.registrazioneUtente.presentation.actions.RegistrationAction"
                                name="registrationBean" >
                        <forward name="success"         path="/registra.do"/>
                        <forward name="error"   path="/view.do"/>
                        <forward name="failure"         path="pannello.errore.screen"/>    
... ... other stuff ... ...
 <controller pagePattern="$P" inputForward="false" processorClass="org.apache.portals.bridges.struts.PortletRequestProcessor"/>

---------------------------------------------
this the jsp file (portion)
---------------------------------------------
<html:link action="/TestRegistrazione">Test registrazione</html:link>
<html:form action="/registrationAction"> ... ... ... </html:form>


the link and the form destination point outside the portal
they point to the application directly

anyone has an idea?
thanks

NB thanks to M. Lecoq that replyed to me directly