Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I make WebSphere Commerce serve a remote JSP?

Status
Not open for further replies.
Aug 20, 2010
4
US
Hello all. I joined this forum specifically to ask this question (but now that I've found 'here', I think I'll probably like it enough to hang around :) )

At any rate: I am in need of *some*....*any* help regarding any configuration possibilities for having WebSphere Commerce serve a remote JSP.

(...Either through Commerce configuration, or by dictating a jsp location to the server in ANY other possible way...nothing is too outlandish at this point, although simpler is -as always- preferable)

In my head, I've got something like the following cooking up:

I pull jsps from subversion and have them in a working directory that's served out by a local installation of Tomcat6. I would have Apache sitting in the front to handle serving static content like images, script files, stylesheets, etc, etc and configured with the RewriteRules necessary to hit Tomcat. Tomcat would ProxyPass everything to the existing WebSphere Commerce server, but instead of Commerce serving up its local copy of the JSP, it would (somehow...this is where I'm kinda looking for some magic to happen lol) reply back to Tomcat and Tomcat would serve up its own local JSP to Apache and Apache would display the page to the user.

Essentially, we would gain the ability to make simple notepad changes to a local JSP and actually see those changes to it on the fly.

Thanks a lot for your time. (I'm still actively digging for info, btw. ...I'm just not finding anything :\ )
 
But JSP are not static resources, they're compiled and run at the server, you have to choose where do you want to do it.

Cheers,
Dian
 
but of course JSPs are not static resources :) ...and of course they are compiled and run from a server. (...did you read my post? They're being served by Tomcat)

I'll give the rundown one more time in a different way:

There's a Servlet running on a WebSphere Commerce server that I am authorized to call. WCS maintains all of the strut mappings to all of the pages, and all of the business logic in EJBs as well as the JEE server and the database. The RequestServlet running on WCS is compiled from code that is held in subversion.

What I'm wanting to do is this: I want to pull the code for the Servlet from subversion and serve the pages from Tomcat. I'm trying to get the WCS RequestServlet configured to act as an HTTPProxyServlet on demand such that an Apache server can set a Header flag when making a request to WCS. The RequestServlet would then make its appropriate calls to all of its resources (that are obfuscated from my Tomcat Servlet) and then *instead of serving a page back to Apache **from itself**, it would take the information sent by Apache to delegate to my Tomcat instance.

For instance:


Apache
---------
<VirtualHost 127.0.0.1>
DocumentRoot "C:/Corporate Sites/brand1"
ServerName brand1.local

RewriteEngine On
RewriteRule .* - [E=TOMCAT_IP:192.168.12.234]
RewriteRule .* - [E=TOMCAT_PORT:8080]
RewriteRule .* - [E=TOMCAT_HOST:brand1]
RewriteRule .* - [E=ORIGIN_IP:192.168.12.233]
RequestHeader append on-behalf-of %{TOMCAT_IP}e
RequestHeader append on-behalf-of %{TOMCAT_PORT}e
RequestHeader append on-behalf-of %{TOMCAT_HOST}e
RequestHeader append origin-ip %{ORIGIN_IP}e

RewriteCond %{REQUEST_URI} ^/$
RewriteRule ^/webapp/(.*) /webapp/ [P,L]
</VirtualHost>

...WebCommerceServer is called test.brand1.com and runs on port 80 on a separate physical box.

I set the RequestHeader fields so that WCS can know the IP it needs to call back to, because I don't want it to return directly to Apache. In this case, I want it to delegate to 192.168.12.123:8080 AFTER making all of the necessary BL calls.


Tomcat's server.xml is configured with the following host:
<Host name="brand1.local" appBase="C:\Apache\Tomcat 6.0.29\apache-tomcat-6.0.29\hosts\brand1"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">

It is THIS host that I need to serve, but it needs to be passed everything from WCS from the RequestServlet.

So the round trip would be this:

Apache ---------[Tomcat location in Header]--------> WCS ?
? Servlet ids header. Switches to Proxy mode <?
?>*Servlet processes as if it were requested directly

but when processing is finished and the servlet is ready to serve a JSP back to the calling client, the HTTPProxy kicks in and sends the "request to serve" to Tomcat along with pushing the "origin" information back into the HTTP Header

Tomcat then reads the origin HTTP Header, and serves its copy of the page back to Apache (origin)


Is this plausible? Did I clear anything up at all?
 
(Repointed the question, same issue remains)

Does anyone know of a way to pass session data between Websphere Commerce and ANY servlet engine other than WCS?
 
(Repointing the question)

Does anyone know of a way to pass session data between Websphere Commerce and ANY servlet engine other than WCS?
 
I don't believe what you are describing is functional. As soon as the content leaves WCS it will be HTML not a JSP. What you are wanting is either a WebService call (from server to server) to get the data you want into Tomcat and then it processes the JSP and passes it back to Apache, OR if you included an AJAX script on the Tomcat page so when it got back to Apache (well, the end client actually) it would try to pull the data from WCS.

Do you see what I mean?
[tt]
Apache -> Tomcat -(Web Service call)-> WCS ?
Apache <- Tomcat <- - - - - - - - - - - - -? [/tt]

or

[tt]
Apache -> Tomcat ?
Apache <- - - - -?
Apache -> AJAX -> WCS ?
Apache <- - - - - - - ?[/tt]

both ways have pros and cons.

Einstein47 (Starbase47.com)
“PI is like love - simple, natural, irrational, endless, and very important“
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top