6.1 sp5: URL Forward and Servlet need help

Hi all,

I am running SunOne 6.1 SP5 under Solaris 5.9

I have set up a URL forward from "/" to an external static page.

I also have a servlet at "/servlet/redirect_xxx".

Using the default obj.conf I found that the redirect was taking precedence and I could not reference the servlet.

I have tweaked the obj.conf file so that the servlet is now working (by reordering the NameTrans declarations, but now the redirect is not working. I cant seem to find any way to get both my functions to work.

Is there a global setting that I can use to ensure that the full URI path is checked rather than the substring (which the engine appears to be doing) ?

Default obj.conf:

NameTrans fn="ntrans-j2ee" name="j2ee"

NameTrans fn="pfx2dir" from="/mc-icons" dir="/opt/SUNWwbsvr/ns-icons" name="es-internal"

NameTrans fn="redirect" from="/" url="http://www.thewest.com.au/default.aspx?MenuID=99&ContentID=116"

NameTrans fn="document-root" root="$docroot"

Edited obj.conf:

NameTrans fn="pfx2dir" from="/mc-icons" dir="/opt/SUNWwbsvr/ns-icons" name="es-internal"

NameTrans fn="ntrans-j2ee" name="j2ee"

NameTrans fn="document-root" root="$docroot"

NameTrans fn="redirect" from="/" url="http://www.thewest.com.au/default.aspx?MenuID=99&ContentID=116"

Thanks in advance.

[1365 byte] By [r_defonsekaa] at [2007-11-27 7:07:13]
# 1

More info:

I deployed the servlet by defining the WEB-INF\lib subdirectory under the document root directory. Do I need to deploy as a strict WAR or can I deploy in this way ?

BTW I can reference the servlet if URL -orwarding is switched off.

I have also downloaded SP7 in case this fixes the problem. But I have not installed SP7 yet. I am hoping for a global solution instead of fiddling with order of the statements in obj.conf :)

Thanks again.

r_defonsekaa at 2007-7-12 18:58:35 > top of Java-index,Web & Directory Servers,Web Servers...
# 2

The redirect SAF's from parameter specifies a prefix. Since every URI begins with a /, the prefix / will match every URI.

If you want to redirect only requests for the single URI /, you could use the following:<Client uri="/">

NameTrans fn="redirect" from="/" url="http://example.com/"

</Client>The above directive should appear before the ntrans-j2ee and document-root directives.

elvinga at 2007-7-12 18:58:35 > top of Java-index,Web & Directory Servers,Web Servers...
# 3
I tried this and it worked. Thank you.
r_defonsekaa at 2007-7-12 18:58:35 > top of Java-index,Web & Directory Servers,Web Servers...