Remove(Mask) Control Servlet URI

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Remove(Mask) Control Servlet URI

euronymous
Hi list...
Jaques correctly pointed to post my question here, instead of Dev: here it is...Hope someone is gonna help us ;) Thanks

Hi list

we were looking around possibilities to remove the Control Servlet from a customized application, in a way that the frontend will not contain in the URL /control/.

Is there a way to do that directly in the application web.xml descriptor? That's just a strange request of one of our customers...for us it is definitely ok to leave it ;) But you all know that customer request must be satisfied (as much as we can)...

We tried urlrewrite, without totally success. Using a rule like the following one, we were able to filter the content generated from response.encodeURL:

 <outbound-rule>
        <note>
            When response.encodeURL is called (RequestHandler.encodeURL)
            the url /control/something will be rewritten to /something.

            The above rule and this outbound-rule means that end users should never see the
            url /control/something /something both in thier location bar and in hyperlinks
            in your pages.
        </note>
        <from>^/control/(.*)$</from>
        <to>/$1</to>
    </outbound-rule>

Anyway we need also another rule to filter input...something like this (not working):

 <rule>
        <note>
            Requests without /control/ will be silently rewritten.
        </note>
       
        <from>^/(.+)$</from>
        <to>/control/$1</to>
    </rule>

I've read that months ago Jaques was speaking on urlrewrite...
Is there someone that had our same necessity before?

Thanks list, thanks Ofbiz developers

Michele Orrù
Reply | Threaded
Open this post in threaded view
|

Re: Remove(Mask) Control Servlet URI

BJ Freeman
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I  have not done this, but just some thoughts.
1) you need to start at
^/applicationname/control/ if your using any of the application that
come with ofbiz, since there is a a control.xml for each application.
and then direct to the application.
so even if you removed the /control
you still need the /applicationname in the URL
I did attempt at one time to put all the applications thru one
control.xml but ran into integration problems.

lets say you have only one application and you are not calling any other
 of the built-in screens.
another approach is to use an apache front end and ajp
http://docs.ofbiz.org/display/OFBIZ/FAQ+-+Tips+-+Tricks+-+Cookbook+-+HowTo#FAQ-Tips-Tricks-Cookbook-HowTo-HTTPD

you can use rewrite rules


euronymous sent the following on 1/22/2009 11:26 AM:

> Hi list...
> Jaques correctly pointed to post my question here, instead of Dev: here it
> is...Hope someone is gonna help us ;) Thanks
>
> Hi list
>
> we were looking around possibilities to remove the Control Servlet from a
> customized application, in a way that the frontend will not contain in the
> URL /control/.
>
> Is there a way to do that directly in the application web.xml descriptor?
> That's just a strange request of one of our customers...for us it is
> definitely ok to leave it ;) But you all know that customer request must be
> satisfied (as much as we can)...
>
> We tried urlrewrite, without totally success. Using a rule like the
> following one, we were able to filter the content generated from
> response.encodeURL:
>
>  <outbound-rule>
>         <note>
>             When response.encodeURL is called (RequestHandler.encodeURL)
>             the url /control/something will be rewritten to /something.
>
>             The above rule and this outbound-rule means that end users
> should never see the
>             url /control/something /something both in thier location bar and
> in hyperlinks
>             in your pages.
>         </note>
>         <from>^/control/(.*)$</from>
>         <to>/$1</to>
>     </outbound-rule>
>
> Anyway we need also another rule to filter input...something like this (not
> working):
>
>  <rule>
>         <note>
>             Requests without /control/ will be silently rewritten.
>         </note>
>        
>         <from>^/(.+)$</from>
>         <to>/control/$1</to>
>     </rule>
>
> I've read that months ago Jaques was speaking on urlrewrite...
> Is there someone that had our same necessity before?
>
> Thanks list, thanks Ofbiz developers
>
> Michele Orrù
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFJeNH4rP3NbaWWqE4RAn1FAJ4j3WyVLzuK1qNFDPHgjG6q+6elWACfSlYg
gVt8f5euOPH5cfd1F5krKaU=
=gJHm
-----END PGP SIGNATURE-----
Reply | Threaded
Open this post in threaded view
|

Re: Remove(Mask) Control Servlet URI

Jacques Le Roux
Administrator
Thanks BJ,

That's also what I suggested on dev ML
So +2 for Apache mod_rewrite so far ;o)

Jacques

From: "BJ Freeman" <[hidden email]>

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> I  have not done this, but just some thoughts.
> 1) you need to start at
> ^/applicationname/control/ if your using any of the application that
> come with ofbiz, since there is a a control.xml for each application.
> and then direct to the application.
> so even if you removed the /control
> you still need the /applicationname in the URL
> I did attempt at one time to put all the applications thru one
> control.xml but ran into integration problems.
>
> lets say you have only one application and you are not calling any other
> of the built-in screens.
> another approach is to use an apache front end and ajp
> http://docs.ofbiz.org/display/OFBIZ/FAQ+-+Tips+-+Tricks+-+Cookbook+-+HowTo#FAQ-Tips-Tricks-Cookbook-HowTo-HTTPD
>
> you can use rewrite rules
>
>
> euronymous sent the following on 1/22/2009 11:26 AM:
>> Hi list...
>> Jaques correctly pointed to post my question here, instead of Dev: here it
>> is...Hope someone is gonna help us ;) Thanks
>>
>> Hi list
>>
>> we were looking around possibilities to remove the Control Servlet from a
>> customized application, in a way that the frontend will not contain in the
>> URL /control/.
>>
>> Is there a way to do that directly in the application web.xml descriptor?
>> That's just a strange request of one of our customers...for us it is
>> definitely ok to leave it ;) But you all know that customer request must be
>> satisfied (as much as we can)...
>>
>> We tried urlrewrite, without totally success. Using a rule like the
>> following one, we were able to filter the content generated from
>> response.encodeURL:
>>
>>  <outbound-rule>
>>         <note>
>>             When response.encodeURL is called (RequestHandler.encodeURL)
>>             the url /control/something will be rewritten to /something.
>>
>>             The above rule and this outbound-rule means that end users
>> should never see the
>>             url /control/something /something both in thier location bar and
>> in hyperlinks
>>             in your pages.
>>         </note>
>>         <from>^/control/(.*)$</from>
>>         <to>/$1</to>
>>     </outbound-rule>
>>
>> Anyway we need also another rule to filter input...something like this (not
>> working):
>>
>>  <rule>
>>         <note>
>>             Requests without /control/ will be silently rewritten.
>>         </note>
>>
>>         <from>^/(.+)$</from>
>>         <to>/control/$1</to>
>>     </rule>
>>
>> I've read that months ago Jaques was speaking on urlrewrite...
>> Is there someone that had our same necessity before?
>>
>> Thanks list, thanks Ofbiz developers
>>
>> Michele Orrù
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.6 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFJeNH4rP3NbaWWqE4RAn1FAJ4j3WyVLzuK1qNFDPHgjG6q+6elWACfSlYg
> gVt8f5euOPH5cfd1F5krKaU=
> =gJHm
> -----END PGP SIGNATURE-----
>

Reply | Threaded
Open this post in threaded view
|

Re: Remove(Mask) Control Servlet URI

dev-33
</lurk>
Hi, new lurker here, just stumbled on an interesting blog post that  
deals with this (and SEO):
 From http://www.joshlong.com/jl/entry/web_framework_utility_llibraries_urlrewrite 
:
<quote>
Url Rewriting For Servlets

I've had to do some URL rewriting to support search engine  
optimization. SEO is something of a black art, I admit, but there'  
still something to be said for building your web application wit  
search engine navigability in mind.  Naturally, this means man things,  
not the least of which exposing your pages on friendly book markable  
URLs. Spring MVC supports accessing low level servle configuration,  
but what is most appropriate for this sort o requirement is  
mod_rewrite. Mod_rewrite let's you map URLs coming into the server and  
transform them into other types of URLs, which then are used to access  
HTTP resources on your application. I didn't have - and didn't want to  
commit to – a full installation of Apache HTTPD or anything like that.  
Instead, I wanted something inside the servlet container. I stumbled  
upon UrlRewriteFilter. It's fairly well documented and definitely  
powerful enough for 80% of your usecases. It can even match against  
request variables. It's got support for wildcard syntax as well as  
regular expressions. My regex-fu was strong enough that it just made  
sense to use that from the get-go.
</quote>

HTH,
Dave
North Creek
<lurk>

On 22-Jan-09, at 3:20 PM, Jacques Le Roux wrote:

> Thanks BJ,
>
> That's also what I suggested on dev ML
> So +2 for Apache mod_rewrite so far ;o)
>
> Jacques
>
> From: "BJ Freeman" <[hidden email]>
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> I  have not done this, but just some thoughts.
>> 1) you need to start at
>> ^/applicationname/control/ if your using any of the application that
>> come with ofbiz, since there is a a control.xml for each application.
>> and then direct to the application.
>> so even if you removed the /control
>> you still need the /applicationname in the URL
>> I did attempt at one time to put all the applications thru one
>> control.xml but ran into integration problems.
>>
>> lets say you have only one application and you are not calling any  
>> other
>> of the built-in screens.
>> another approach is to use an apache front end and ajp
>> http://docs.ofbiz.org/display/OFBIZ/FAQ+-+Tips+-+Tricks+-+Cookbook+-+HowTo#FAQ-Tips-Tricks-Cookbook-HowTo-HTTPD
>>
>> you can use rewrite rules
>>
>>
>> euronymous sent the following on 1/22/2009 11:26 AM:
>>> Hi list...
>>> Jaques correctly pointed to post my question here, instead of Dev:  
>>> here it
>>> is...Hope someone is gonna help us ;) Thanks
>>>
>>> Hi list
>>>
>>> we were looking around possibilities to remove the Control Servlet  
>>> from a
>>> customized application, in a way that the frontend will not  
>>> contain in the
>>> URL /control/.
>>>
>>> Is there a way to do that directly in the application web.xml  
>>> descriptor?
>>> That's just a strange request of one of our customers...for us it is
>>> definitely ok to leave it ;) But you all know that customer  
>>> request must be
>>> satisfied (as much as we can)...
>>>
>>> We tried urlrewrite, without totally success. Using a rule like the
>>> following one, we were able to filter the content generated from
>>> response.encodeURL:
>>>
>>> <outbound-rule>
>>>        <note>
>>>            When response.encodeURL is called  
>>> (RequestHandler.encodeURL)
>>>            the url /control/something will be rewritten to /
>>> something.
>>>
>>>            The above rule and this outbound-rule means that end  
>>> users
>>> should never see the
>>>            url /control/something /something both in thier  
>>> location bar and
>>> in hyperlinks
>>>            in your pages.
>>>        </note>
>>>        <from>^/control/(.*)$</from>
>>>        <to>/$1</to>
>>>    </outbound-rule>
>>>
>>> Anyway we need also another rule to filter input...something like  
>>> this (not
>>> working):
>>>
>>> <rule>
>>>        <note>
>>>            Requests without /control/ will be silently rewritten.
>>>        </note>
>>>
>>>        <from>^/(.+)$</from>
>>>        <to>/control/$1</to>
>>>    </rule>
>>>
>>> I've read that months ago Jaques was speaking on urlrewrite...
>>> Is there someone that had our same necessity before?
>>>
>>> Thanks list, thanks Ofbiz developers
>>>
>>> Michele Orrù
>> -----BEGIN PGP SIGNATURE-----
>> Version: GnuPG v1.4.6 (MingW32)
>> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>>
>> iD8DBQFJeNH4rP3NbaWWqE4RAn1FAJ4j3WyVLzuK1qNFDPHgjG6q+6elWACfSlYg
>> gVt8f5euOPH5cfd1F5krKaU=
>> =gJHm
>> -----END PGP SIGNATURE-----
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Remove(Mask) Control Servlet URI

BJ Freeman
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

feel free to document you success in the wiki

dev sent the following on 1/22/2009 4:02 PM:

> </lurk>
> Hi, new lurker here, just stumbled on an interesting blog post that
> deals with this (and SEO):
> From
> http://www.joshlong.com/jl/entry/web_framework_utility_llibraries_urlrewrite:
>
> <quote>
> Url Rewriting For Servlets
>
> I've had to do some URL rewriting to support search engine optimization.
> SEO is something of a black art, I admit, but there' still something to
> be said for building your web application wit search engine navigability
> in mind.  Naturally, this means man things, not the least of which
> exposing your pages on friendly book markable URLs. Spring MVC supports
> accessing low level servle configuration, but what is most appropriate
> for this sort o requirement is mod_rewrite. Mod_rewrite let's you map
> URLs coming into the server and transform them into other types of URLs,
> which then are used to access HTTP resources on your application. I
> didn't have - and didn't want to commit to – a full installation of
> Apache HTTPD or anything like that. Instead, I wanted something inside
> the servlet container. I stumbled upon UrlRewriteFilter. It's fairly
> well documented and definitely powerful enough for 80% of your usecases.
> It can even match against request variables. It's got support for
> wildcard syntax as well as regular expressions. My regex-fu was strong
> enough that it just made sense to use that from the get-go.
> </quote>
>
> HTH,
> Dave
> North Creek
> <lurk>
>
> On 22-Jan-09, at 3:20 PM, Jacques Le Roux wrote:
>
>> Thanks BJ,
>>
>> That's also what I suggested on dev ML
>> So +2 for Apache mod_rewrite so far ;o)
>>
>> Jacques
>>
>> From: "BJ Freeman" <[hidden email]>
> I  have not done this, but just some thoughts.
> 1) you need to start at
> ^/applicationname/control/ if your using any of the application that
> come with ofbiz, since there is a a control.xml for each application.
> and then direct to the application.
> so even if you removed the /control
> you still need the /applicationname in the URL
> I did attempt at one time to put all the applications thru one
> control.xml but ran into integration problems.
>
> lets say you have only one application and you are not calling any other
> of the built-in screens.
> another approach is to use an apache front end and ajp
> http://docs.ofbiz.org/display/OFBIZ/FAQ+-+Tips+-+Tricks+-+Cookbook+-+HowTo#FAQ-Tips-Tricks-Cookbook-HowTo-HTTPD
>
>
> you can use rewrite rules
>
>
> euronymous sent the following on 1/22/2009 11:26 AM:
>>>>> Hi list...
>>>>> Jaques correctly pointed to post my question here, instead of Dev:
>>>>> here it
>>>>> is...Hope someone is gonna help us ;) Thanks
>>>>>
>>>>> Hi list
>>>>>
>>>>> we were looking around possibilities to remove the Control Servlet
>>>>> from a
>>>>> customized application, in a way that the frontend will not contain
>>>>> in the
>>>>> URL /control/.
>>>>>
>>>>> Is there a way to do that directly in the application web.xml
>>>>> descriptor?
>>>>> That's just a strange request of one of our customers...for us it is
>>>>> definitely ok to leave it ;) But you all know that customer request
>>>>> must be
>>>>> satisfied (as much as we can)...
>>>>>
>>>>> We tried urlrewrite, without totally success. Using a rule like the
>>>>> following one, we were able to filter the content generated from
>>>>> response.encodeURL:
>>>>>
>>>>> <outbound-rule>
>>>>>        <note>
>>>>>            When response.encodeURL is called (RequestHandler.encodeURL)
>>>>>            the url /control/something will be rewritten to /something.
>>>>>
>>>>>            The above rule and this outbound-rule means that end users
>>>>> should never see the
>>>>>            url /control/something /something both in thier location
>>>>> bar and
>>>>> in hyperlinks
>>>>>            in your pages.
>>>>>        </note>
>>>>>        <from>^/control/(.*)$</from>
>>>>>        <to>/$1</to>
>>>>>    </outbound-rule>
>>>>>
>>>>> Anyway we need also another rule to filter input...something like
>>>>> this (not
>>>>> working):
>>>>>
>>>>> <rule>
>>>>>        <note>
>>>>>            Requests without /control/ will be silently rewritten.
>>>>>        </note>
>>>>>
>>>>>        <from>^/(.+)$</from>
>>>>>        <to>/control/$1</to>
>>>>>    </rule>
>>>>>
>>>>> I've read that months ago Jaques was speaking on urlrewrite...
>>>>> Is there someone that had our same necessity before?
>>>>>
>>>>> Thanks list, thanks Ofbiz developers
>>>>>
>>>>> Michele Orrù
>>
>>

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFJeSzBrP3NbaWWqE4RAmbQAKClFDjkTpmlfV8UwygdVdzRDb+HBACcC6HZ
9qlJQvyMGVVODtLs0eg6lRw=
=o3vc
-----END PGP SIGNATURE-----
Reply | Threaded
Open this post in threaded view
|

Re: Remove(Mask) Control Servlet URI

rajsaini
In reply to this post by euronymous

If you are fronting your OFBiz with Apache web server, you can use the
mod_rewrite along with mod_proxy and mod_proxy_ajp modules to rewrite
the URLs. You may also need mod_proxy_html. I used it for one our client
and it worked pretty well.

Thanks,

Raj

euronymous wrote:

> Hi list...
> Jaques correctly pointed to post my question here, instead of Dev: here it
> is...Hope someone is gonna help us ;) Thanks
>
> Hi list
>
> we were looking around possibilities to remove the Control Servlet from a
> customized application, in a way that the frontend will not contain in the
> URL /control/.
>
> Is there a way to do that directly in the application web.xml descriptor?
> That's just a strange request of one of our customers...for us it is
> definitely ok to leave it ;) But you all know that customer request must be
> satisfied (as much as we can)...
>
> We tried urlrewrite, without totally success. Using a rule like the
> following one, we were able to filter the content generated from
> response.encodeURL:
>
>  <outbound-rule>
>         <note>
>             When response.encodeURL is called (RequestHandler.encodeURL)
>             the url /control/something will be rewritten to /something.
>
>             The above rule and this outbound-rule means that end users
> should never see the
>             url /control/something /something both in thier location bar and
> in hyperlinks
>             in your pages.
>         </note>
>         <from>^/control/(.*)$</from>
>         <to>/$1</to>
>     </outbound-rule>
>
> Anyway we need also another rule to filter input...something like this (not
> working):
>
>  <rule>
>         <note>
>             Requests without /control/ will be silently rewritten.
>         </note>
>        
>         <from>^/(.+)$</from>
>         <to>/control/$1</to>
>     </rule>
>
> I've read that months ago Jaques was speaking on urlrewrite...
> Is there someone that had our same necessity before?
>
> Thanks list, thanks Ofbiz developers
>
> Michele Orrù
>  

Reply | Threaded
Open this post in threaded view
|

Re: Remove(Mask) Control Servlet URI

euronymous
In reply to this post by Jacques Le Roux
Thank you Jaques and BJ to have replied to my question...

but I still don't understand how to solve my problem.

We're already using in production proxy_ajp with tomcat, to run ofbiz behind apache and manage SSL on apache. I tried a lot to understand mod_rewrite, and how it works, but without success...Well I was able to remove "control" from the incoming request, but clearly ofbiz add it if by default if it cannot find it in the request.

I was more confortable with urlrewrite...
So please  post an example solution to  my problem (mod_rewrite or urlrewrite), if you already got a chance to analyze it.

Using urlrewrite I was able to remove "control" filtering the outgoing requests....but how can I automatically add it in incoming requests?

Thanks for your support

Michele


jacques.le.roux wrote
Thanks BJ,

That's also what I suggested on dev ML
So +2 for Apache mod_rewrite so far ;o)

Jacques

From: "BJ Freeman" <bjfree@free-man.net>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> I  have not done this, but just some thoughts.
> 1) you need to start at
> ^/applicationname/control/ if your using any of the application that
> come with ofbiz, since there is a a control.xml for each application.
> and then direct to the application.
> so even if you removed the /control
> you still need the /applicationname in the URL
> I did attempt at one time to put all the applications thru one
> control.xml but ran into integration problems.
>
> lets say you have only one application and you are not calling any other
> of the built-in screens.
> another approach is to use an apache front end and ajp
> http://docs.ofbiz.org/display/OFBIZ/FAQ+-+Tips+-+Tricks+-+Cookbook+-+HowTo#FAQ-Tips-Tricks-Cookbook-HowTo-HTTPD
>
> you can use rewrite rules
>
>
> euronymous sent the following on 1/22/2009 11:26 AM:
>> Hi list...
>> Jaques correctly pointed to post my question here, instead of Dev: here it
>> is...Hope someone is gonna help us ;) Thanks
>>
>> Hi list
>>
>> we were looking around possibilities to remove the Control Servlet from a
>> customized application, in a way that the frontend will not contain in the
>> URL /control/.
>>
>> Is there a way to do that directly in the application web.xml descriptor?
>> That's just a strange request of one of our customers...for us it is
>> definitely ok to leave it ;) But you all know that customer request must be
>> satisfied (as much as we can)...
>>
>> We tried urlrewrite, without totally success. Using a rule like the
>> following one, we were able to filter the content generated from
>> response.encodeURL:
>>
>>  <outbound-rule>
>>         <note>
>>             When response.encodeURL is called (RequestHandler.encodeURL)
>>             the url /control/something will be rewritten to /something.
>>
>>             The above rule and this outbound-rule means that end users
>> should never see the
>>             url /control/something /something both in thier location bar and
>> in hyperlinks
>>             in your pages.
>>         </note>
>>         <from>^/control/(.*)$</from>
>>         <to>/$1</to>
>>     </outbound-rule>
>>
>> Anyway we need also another rule to filter input...something like this (not
>> working):
>>
>>  <rule>
>>         <note>
>>             Requests without /control/ will be silently rewritten.
>>         </note>
>>
>>         <from>^/(.+)$</from>
>>         <to>/control/$1</to>
>>     </rule>
>>
>> I've read that months ago Jaques was speaking on urlrewrite...
>> Is there someone that had our same necessity before?
>>
>> Thanks list, thanks Ofbiz developers
>>
>> Michele Orrù
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.6 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFJeNH4rP3NbaWWqE4RAn1FAJ4j3WyVLzuK1qNFDPHgjG6q+6elWACfSlYg
> gVt8f5euOPH5cfd1F5krKaU=
> =gJHm
> -----END PGP SIGNATURE-----
>
Reply | Threaded
Open this post in threaded view
|

Re: Remove(Mask) Control Servlet URI

BJ Freeman
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

The link i gave has an example in it.

euronymous sent the following on 1/23/2009 2:52 AM:

> Thank you Jaques and BJ to have replied to my question...
>
> but I still don't understand how to solve my problem.
>
> We're already using in production proxy_ajp with tomcat, to run ofbiz behind
> apache and manage SSL on apache. I tried a lot to understand mod_rewrite,
> and how it works, but without success...Well I was able to remove "control"
> from the incoming request, but clearly ofbiz add it if by default if it
> cannot find it in the request.
>
> I was more confortable with urlrewrite...
> So please  post an example solution to  my problem (mod_rewrite or
> urlrewrite), if you already got a chance to analyze it.
>
> Using urlrewrite I was able to remove "control" filtering the outgoing
> requests....but how can I automatically add it in incoming requests?
>
> Thanks for your support
>
> Michele
>
>
>
> jacques.le.roux wrote:
>> Thanks BJ,
>>
>> That's also what I suggested on dev ML
>> So +2 for Apache mod_rewrite so far ;o)
>>
>> Jacques
>>
>> From: "BJ Freeman" <[hidden email]>
> I  have not done this, but just some thoughts.
> 1) you need to start at
> ^/applicationname/control/ if your using any of the application that
> come with ofbiz, since there is a a control.xml for each application.
> and then direct to the application.
> so even if you removed the /control
> you still need the /applicationname in the URL
> I did attempt at one time to put all the applications thru one
> control.xml but ran into integration problems.
>
> lets say you have only one application and you are not calling any other
> of the built-in screens.
> another approach is to use an apache front end and ajp
> http://docs.ofbiz.org/display/OFBIZ/FAQ+-+Tips+-+Tricks+-+Cookbook+-+HowTo#FAQ-Tips-Tricks-Cookbook-HowTo-HTTPD
>
> you can use rewrite rules
>
>
> euronymous sent the following on 1/22/2009 11:26 AM:
>>>>> Hi list...
>>>>> Jaques correctly pointed to post my question here, instead of Dev: here
>>>>> it
>>>>> is...Hope someone is gonna help us ;) Thanks
>>>>>
>>>>> Hi list
>>>>>
>>>>> we were looking around possibilities to remove the Control Servlet from
>>>>> a
>>>>> customized application, in a way that the frontend will not contain in
>>>>> the
>>>>> URL /control/.
>>>>>
>>>>> Is there a way to do that directly in the application web.xml
>>>>> descriptor?
>>>>> That's just a strange request of one of our customers...for us it is
>>>>> definitely ok to leave it ;) But you all know that customer request must
>>>>> be
>>>>> satisfied (as much as we can)...
>>>>>
>>>>> We tried urlrewrite, without totally success. Using a rule like the
>>>>> following one, we were able to filter the content generated from
>>>>> response.encodeURL:
>>>>>
>>>>>  <outbound-rule>
>>>>>         <note>
>>>>>             When response.encodeURL is called (RequestHandler.encodeURL)
>>>>>             the url /control/something will be rewritten to /something.
>>>>>
>>>>>             The above rule and this outbound-rule means that end users
>>>>> should never see the
>>>>>             url /control/something /something both in thier location bar
>>>>> and
>>>>> in hyperlinks
>>>>>             in your pages.
>>>>>         </note>
>>>>>         <from>^/control/(.*)$</from>
>>>>>         <to>/$1</to>
>>>>>     </outbound-rule>
>>>>>
>>>>> Anyway we need also another rule to filter input...something like this
>>>>> (not
>>>>> working):
>>>>>
>>>>>  <rule>
>>>>>         <note>
>>>>>             Requests without /control/ will be silently rewritten.
>>>>>         </note>
>>>>>
>>>>>         <from>^/(.+)$</from>
>>>>>         <to>/control/$1</to>
>>>>>     </rule>
>>>>>
>>>>> I've read that months ago Jaques was speaking on urlrewrite...
>>>>> Is there someone that had our same necessity before?
>>>>>
>>>>> Thanks list, thanks Ofbiz developers
>>>>>
>>>>> Michele Orrù
>>>
>>
>>

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFJeaLPrP3NbaWWqE4RAhwOAJ9sRiHl49Zcro/05o0GeRpQi2vTZQCePzLW
moboY0T3Sjc7MzSYVKMgkHk=
=829H
-----END PGP SIGNATURE-----
Reply | Threaded
Open this post in threaded view
|

Re: Remove(Mask) Control Servlet URI

Vince Clark
Can "/control" be removed/changed in this section of a web.xml file?

<servlet>
<servlet-name>ControlServlet</servlet-name>
<display-name>ControlServlet</display-name>
<description>Main Control Servlet</description>
<servlet-class>org.ofbiz.webapp.control.ControlServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>ControlServlet</servlet-name>
<url-pattern>/control/*</url-pattern>
</servlet-mapping>

----- Original Message -----
From: "BJ Freeman" <[hidden email]>
To: [hidden email]
Sent: Friday, January 23, 2009 3:58:23 AM (GMT-0700) America/Denver
Subject: Re: Remove(Mask) Control Servlet URI

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

The link i gave has an example in it.

euronymous sent the following on 1/23/2009 2:52 AM:

> Thank you Jaques and BJ to have replied to my question...
>
> but I still don't understand how to solve my problem.
>
> We're already using in production proxy_ajp with tomcat, to run ofbiz behind
> apache and manage SSL on apache. I tried a lot to understand mod_rewrite,
> and how it works, but without success...Well I was able to remove "control"
> from the incoming request, but clearly ofbiz add it if by default if it
> cannot find it in the request.
>
> I was more confortable with urlrewrite...
> So please post an example solution to my problem (mod_rewrite or
> urlrewrite), if you already got a chance to analyze it.
>
> Using urlrewrite I was able to remove "control" filtering the outgoing
> requests....but how can I automatically add it in incoming requests?
>
> Thanks for your support
>
> Michele
>
>
>
> jacques.le.roux wrote:
>> Thanks BJ,
>>
>> That's also what I suggested on dev ML
>> So +2 for Apache mod_rewrite so far ;o)
>>
>> Jacques
>>
>> From: "BJ Freeman" <[hidden email]>
> I have not done this, but just some thoughts.
> 1) you need to start at
> ^/applicationname/control/ if your using any of the application that
> come with ofbiz, since there is a a control.xml for each application.
> and then direct to the application.
> so even if you removed the /control
> you still need the /applicationname in the URL
> I did attempt at one time to put all the applications thru one
> control.xml but ran into integration problems.
>
> lets say you have only one application and you are not calling any other
> of the built-in screens.
> another approach is to use an apache front end and ajp
> http://docs.ofbiz.org/display/OFBIZ/FAQ+-+Tips+-+Tricks+-+Cookbook+-+HowTo#FAQ-Tips-Tricks-Cookbook-HowTo-HTTPD 
>
> you can use rewrite rules
>
>
> euronymous sent the following on 1/22/2009 11:26 AM:
>>>>> Hi list...
>>>>> Jaques correctly pointed to post my question here, instead of Dev: here
>>>>> it
>>>>> is...Hope someone is gonna help us ;) Thanks
>>>>>
>>>>> Hi list
>>>>>
>>>>> we were looking around possibilities to remove the Control Servlet from
>>>>> a
>>>>> customized application, in a way that the frontend will not contain in
>>>>> the
>>>>> URL /control/.
>>>>>
>>>>> Is there a way to do that directly in the application web.xml
>>>>> descriptor?
>>>>> That's just a strange request of one of our customers...for us it is
>>>>> definitely ok to leave it ;) But you all know that customer request must
>>>>> be
>>>>> satisfied (as much as we can)...
>>>>>
>>>>> We tried urlrewrite, without totally success. Using a rule like the
>>>>> following one, we were able to filter the content generated from
>>>>> response.encodeURL:
>>>>>
>>>>> <outbound-rule>
>>>>> <note>
>>>>> When response.encodeURL is called (RequestHandler.encodeURL)
>>>>> the url /control/something will be rewritten to /something.
>>>>>
>>>>> The above rule and this outbound-rule means that end users
>>>>> should never see the
>>>>> url /control/something /something both in thier location bar
>>>>> and
>>>>> in hyperlinks
>>>>> in your pages.
>>>>> </note>
>>>>> <from>^/control/(.*)$</from>
>>>>> <to>/$1</to>
>>>>> </outbound-rule>
>>>>>
>>>>> Anyway we need also another rule to filter input...something like this
>>>>> (not
>>>>> working):
>>>>>
>>>>> <rule>
>>>>> <note>
>>>>> Requests without /control/ will be silently rewritten.
>>>>> </note>
>>>>>
>>>>> <from>^/(.+)$</from>
>>>>> <to>/control/$1</to>
>>>>> </rule>
>>>>>
>>>>> I've read that months ago Jaques was speaking on urlrewrite...
>>>>> Is there someone that had our same necessity before?
>>>>>
>>>>> Thanks list, thanks Ofbiz developers
>>>>>
>>>>> Michele Orrù
>>>
>>
>>

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org 

iD8DBQFJeaLPrP3NbaWWqE4RAhwOAJ9sRiHl49Zcro/05o0GeRpQi2vTZQCePzLW
moboY0T3Sjc7MzSYVKMgkHk=
=829H
-----END PGP SIGNATURE-----
Reply | Threaded
Open this post in threaded view
|

Re: Remove(Mask) Control Servlet URI

BJ Freeman
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

some string and or character has to be in
<url-pattern>/c/*</url-pattern>

Vince M. Clark sent the following on 1/24/2009 8:18 PM:

> Can "/control" be removed/changed in this section of a web.xml file?
>
> <servlet>
> <servlet-name>ControlServlet</servlet-name>
> <display-name>ControlServlet</display-name>
> <description>Main Control Servlet</description>
> <servlet-class>org.ofbiz.webapp.control.ControlServlet</servlet-class>
> <load-on-startup>1</load-on-startup>
> </servlet>
> <servlet-mapping>
> <servlet-name>ControlServlet</servlet-name>
> <url-pattern>/control/*</url-pattern>
> </servlet-mapping>
>
> ----- Original Message -----
> From: "BJ Freeman" <[hidden email]>
> To: [hidden email]
> Sent: Friday, January 23, 2009 3:58:23 AM (GMT-0700) America/Denver
> Subject: Re: Remove(Mask) Control Servlet URI
>
> The link i gave has an example in it.
>
> euronymous sent the following on 1/23/2009 2:52 AM:
>> Thank you Jaques and BJ to have replied to my question...
>
>> but I still don't understand how to solve my problem.
>
>> We're already using in production proxy_ajp with tomcat, to run ofbiz behind
>> apache and manage SSL on apache. I tried a lot to understand mod_rewrite,
>> and how it works, but without success...Well I was able to remove "control"
>> from the incoming request, but clearly ofbiz add it if by default if it
>> cannot find it in the request.
>
>> I was more confortable with urlrewrite...
>> So please post an example solution to my problem (mod_rewrite or
>> urlrewrite), if you already got a chance to analyze it.
>
>> Using urlrewrite I was able to remove "control" filtering the outgoing
>> requests....but how can I automatically add it in incoming requests?
>
>> Thanks for your support
>
>> Michele
>
>
>
>> jacques.le.roux wrote:
>>> Thanks BJ,
>>>
>>> That's also what I suggested on dev ML
>>> So +2 for Apache mod_rewrite so far ;o)
>>>
>>> Jacques
>>>
>>> From: "BJ Freeman" <[hidden email]>
>> I have not done this, but just some thoughts.
>> 1) you need to start at
>> ^/applicationname/control/ if your using any of the application that
>> come with ofbiz, since there is a a control.xml for each application.
>> and then direct to the application.
>> so even if you removed the /control
>> you still need the /applicationname in the URL
>> I did attempt at one time to put all the applications thru one
>> control.xml but ran into integration problems.
>
>> lets say you have only one application and you are not calling any other
>> of the built-in screens.
>> another approach is to use an apache front end and ajp
>> http://docs.ofbiz.org/display/OFBIZ/FAQ+-+Tips+-+Tricks+-+Cookbook+-+HowTo#FAQ-Tips-Tricks-Cookbook-HowTo-HTTPD 
>
>> you can use rewrite rules
>
>
>> euronymous sent the following on 1/22/2009 11:26 AM:
>>>>>> Hi list...
>>>>>> Jaques correctly pointed to post my question here, instead of Dev: here
>>>>>> it
>>>>>> is...Hope someone is gonna help us ;) Thanks
>>>>>>
>>>>>> Hi list
>>>>>>
>>>>>> we were looking around possibilities to remove the Control Servlet from
>>>>>> a
>>>>>> customized application, in a way that the frontend will not contain in
>>>>>> the
>>>>>> URL /control/.
>>>>>>
>>>>>> Is there a way to do that directly in the application web.xml
>>>>>> descriptor?
>>>>>> That's just a strange request of one of our customers...for us it is
>>>>>> definitely ok to leave it ;) But you all know that customer request must
>>>>>> be
>>>>>> satisfied (as much as we can)...
>>>>>>
>>>>>> We tried urlrewrite, without totally success. Using a rule like the
>>>>>> following one, we were able to filter the content generated from
>>>>>> response.encodeURL:
>>>>>>
>>>>>> <outbound-rule>
>>>>>> <note>
>>>>>> When response.encodeURL is called (RequestHandler.encodeURL)
>>>>>> the url /control/something will be rewritten to /something.
>>>>>>
>>>>>> The above rule and this outbound-rule means that end users
>>>>>> should never see the
>>>>>> url /control/something /something both in thier location bar
>>>>>> and
>>>>>> in hyperlinks
>>>>>> in your pages.
>>>>>> </note>
>>>>>> <from>^/control/(.*)$</from>
>>>>>> <to>/$1</to>
>>>>>> </outbound-rule>
>>>>>>
>>>>>> Anyway we need also another rule to filter input...something like this
>>>>>> (not
>>>>>> working):
>>>>>>
>>>>>> <rule>
>>>>>> <note>
>>>>>> Requests without /control/ will be silently rewritten.
>>>>>> </note>
>>>>>>
>>>>>> <from>^/(.+)$</from>
>>>>>> <to>/control/$1</to>
>>>>>> </rule>
>>>>>>
>>>>>> I've read that months ago Jaques was speaking on urlrewrite...
>>>>>> Is there someone that had our same necessity before?
>>>>>>
>>>>>> Thanks list, thanks Ofbiz developers
>>>>>>
>>>>>> Michele Orrù
>>>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFJfEe2rP3NbaWWqE4RAregAJ9hzauHj+ndAv+U1IQNa3STmWfALwCfV82Z
cf/uQuuEXXs0ae4Xi/AcvWU=
=rn3t
-----END PGP SIGNATURE-----
Reply | Threaded
Open this post in threaded view
|

Re: Remove(Mask) Control Servlet URI

BJ Freeman
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

forgot-
though you can change the
<url-pattern>/control/*</url-pattern>
ofbiz still constructs the url with
/control/

BJ Freeman sent the following on 1/25/2009 3:06 AM:

> some string and or character has to be in
> <url-pattern>/c/*</url-pattern>
>
> Vince M. Clark sent the following on 1/24/2009 8:18 PM:
>> Can "/control" be removed/changed in this section of a web.xml file?
>
>> <servlet>
>> <servlet-name>ControlServlet</servlet-name>
>> <display-name>ControlServlet</display-name>
>> <description>Main Control Servlet</description>
>> <servlet-class>org.ofbiz.webapp.control.ControlServlet</servlet-class>
>> <load-on-startup>1</load-on-startup>
>> </servlet>
>> <servlet-mapping>
>> <servlet-name>ControlServlet</servlet-name>
>> <url-pattern>/control/*</url-pattern>
>> </servlet-mapping>
>
>> ----- Original Message -----
>> From: "BJ Freeman" <[hidden email]>
>> To: [hidden email]
>> Sent: Friday, January 23, 2009 3:58:23 AM (GMT-0700) America/Denver
>> Subject: Re: Remove(Mask) Control Servlet URI
>
>> The link i gave has an example in it.
>
>> euronymous sent the following on 1/23/2009 2:52 AM:
>>> Thank you Jaques and BJ to have replied to my question...
>>> but I still don't understand how to solve my problem.
>>> We're already using in production proxy_ajp with tomcat, to run ofbiz behind
>>> apache and manage SSL on apache. I tried a lot to understand mod_rewrite,
>>> and how it works, but without success...Well I was able to remove "control"
>>> from the incoming request, but clearly ofbiz add it if by default if it
>>> cannot find it in the request.
>>> I was more confortable with urlrewrite...
>>> So please post an example solution to my problem (mod_rewrite or
>>> urlrewrite), if you already got a chance to analyze it.
>>> Using urlrewrite I was able to remove "control" filtering the outgoing
>>> requests....but how can I automatically add it in incoming requests?
>>> Thanks for your support
>>> Michele
>
>
>>> jacques.le.roux wrote:
>>>> Thanks BJ,
>>>>
>>>> That's also what I suggested on dev ML
>>>> So +2 for Apache mod_rewrite so far ;o)
>>>>
>>>> Jacques
>>>>
>>>> From: "BJ Freeman" <[hidden email]>
>>> I have not done this, but just some thoughts.
>>> 1) you need to start at
>>> ^/applicationname/control/ if your using any of the application that
>>> come with ofbiz, since there is a a control.xml for each application.
>>> and then direct to the application.
>>> so even if you removed the /control
>>> you still need the /applicationname in the URL
>>> I did attempt at one time to put all the applications thru one
>>> control.xml but ran into integration problems.
>>> lets say you have only one application and you are not calling any other
>>> of the built-in screens.
>>> another approach is to use an apache front end and ajp
>>> http://docs.ofbiz.org/display/OFBIZ/FAQ+-+Tips+-+Tricks+-+Cookbook+-+HowTo#FAQ-Tips-Tricks-Cookbook-HowTo-HTTPD 
>>> you can use rewrite rules
>
>>> euronymous sent the following on 1/22/2009 11:26 AM:
>>>>>>> Hi list...
>>>>>>> Jaques correctly pointed to post my question here, instead of Dev: here
>>>>>>> it
>>>>>>> is...Hope someone is gonna help us ;) Thanks
>>>>>>>
>>>>>>> Hi list
>>>>>>>
>>>>>>> we were looking around possibilities to remove the Control Servlet from
>>>>>>> a
>>>>>>> customized application, in a way that the frontend will not contain in
>>>>>>> the
>>>>>>> URL /control/.
>>>>>>>
>>>>>>> Is there a way to do that directly in the application web.xml
>>>>>>> descriptor?
>>>>>>> That's just a strange request of one of our customers...for us it is
>>>>>>> definitely ok to leave it ;) But you all know that customer request must
>>>>>>> be
>>>>>>> satisfied (as much as we can)...
>>>>>>>
>>>>>>> We tried urlrewrite, without totally success. Using a rule like the
>>>>>>> following one, we were able to filter the content generated from
>>>>>>> response.encodeURL:
>>>>>>>
>>>>>>> <outbound-rule>
>>>>>>> <note>
>>>>>>> When response.encodeURL is called (RequestHandler.encodeURL)
>>>>>>> the url /control/something will be rewritten to /something.
>>>>>>>
>>>>>>> The above rule and this outbound-rule means that end users
>>>>>>> should never see the
>>>>>>> url /control/something /something both in thier location bar
>>>>>>> and
>>>>>>> in hyperlinks
>>>>>>> in your pages.
>>>>>>> </note>
>>>>>>> <from>^/control/(.*)$</from>
>>>>>>> <to>/$1</to>
>>>>>>> </outbound-rule>
>>>>>>>
>>>>>>> Anyway we need also another rule to filter input...something like this
>>>>>>> (not
>>>>>>> working):
>>>>>>>
>>>>>>> <rule>
>>>>>>> <note>
>>>>>>> Requests without /control/ will be silently rewritten.
>>>>>>> </note>
>>>>>>>
>>>>>>> <from>^/(.+)$</from>
>>>>>>> <to>/control/$1</to>
>>>>>>> </rule>
>>>>>>>
>>>>>>> I've read that months ago Jaques was speaking on urlrewrite...
>>>>>>> Is there someone that had our same necessity before?
>>>>>>>
>>>>>>> Thanks list, thanks Ofbiz developers
>>>>>>>
>>>>>>> Michele Orrù
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFJfE2rrP3NbaWWqE4RAo77AJ9tl1wfMU8yZayfPinFRlqVELwkogCdGgAU
5KhqPgFBrktEd5CXRGU5JYM=
=cfsF
-----END PGP SIGNATURE-----