• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: TOMCAT deployment + WebServerResources
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: TOMCAT deployment + WebServerResources


  • Subject: Re: TOMCAT deployment + WebServerResources
  • From: Miguel Angel Torres Avila <email@hidden>
  • Date: Wed, 4 Mar 2009 09:47:30 -0600

Sorry List,

I just sent the message I found some mistakes on the example code.

This is the corrected code

public String cssStyle =  ((Application)application()).baseURL() + "/" + ((Application)application()).name()+ ".woa/Contents/WebServerResources/CSS/style.css";

public String myJS = ((Application)application()).baseURL() + "/" + ((Application)application()).name()+ ".woa/Contents/WebServerResources/JS/myJS.js";

On my HTML and WOD file I create components like these:

(HTML FOR CSS)
<webobject name = "ThemeCSS" />
 
(WOD FOR CSS)
ThemeCSS: WOGenericElement {
elementName = "link";
rel = "stylesheet";
type = "text/css";
href = cssStyle;
}

(HTML for _javascript_)

<webobject name = "myJS" />

(WOD for _javascript_)

myJS: WOJavaScript {
scriptSource = myJS;
}


At runtime I get the following HTML code:

(CSS)

<link href="" type="text/css" rel="stylesheet">

(_javascript_)

<script src=""Apple-style-span" style="color: rgb(0, 0, 221); font-size: 12px; -webkit-text-stroke-width: -1; ">.woa/Contents/WebServerResources/JS/myJS.js" type="text/_javascript_">




On Mar 4, 2009, at 9:38 AM, Miguel Angel Torres Avila wrote:

Hi List,


For those who have CSS and _javascript_ files on their WebServerResources and do not use Project Wonder Framework (I think it is easier with that Framework) and want to deploy on TOMCAT I just find a simple way to access those resources.

First, 

On my application y generate links like these to access my resources:

public String cssStyle =  ((Application)application()).baseURL() + "/" + ((Application)application()).name()+ ".woa/Contents/WebServerResources/CSS/style.css";

public String myJS = ((Application)application()).baseURL() + "/" + ((Application)application()).name()+ ".woa/Contents/WebServerResources/JS/myJS.js";

On my HTML and WOD file I create components like these:

(HTML FOR CSS)
<webobject name = "ThemeCSS" />
 
(WOD FOR CSS)
ThemeCSS: WOGenericElement {
elementName = "link";
rel = "stylesheet";
type = "text/css";
href = cssStyle;
}

(HTML for _javascript_)

<webobject name = "myJS" />

(WOD for _javascript_)

loadingJS: WOJavaScript {
scriptSource = myJS;
}


At runtime I get the following HTML code:

(CSS)

<link href="" type="text/css" rel="stylesheet">

(_javascript_)

<script src="" type="text/_javascript_">


In a WebObjects Split installation I just make a copy (or symbolic link) of myApp WebServer resources to MY_WEB_SERVER_ROOT_DIRECTORY/WebObjects/myApp.woa/Contents/


But in Tomcat I was not sure how to do that because on runtime my app was accessible via a URL like this:
http://localhost:8080/myApp/WebObjects/myApp.woa, so my generated URL's for CSS an JS resources (/WebObjects/myApp.woa/Contents/WebServerResources/CSS/style.css" type="text/css)
tried to find it here
http://localhost:8080/WebObjects/myApp.woa/Contents/WebServerResources/CSS/style.css" type="text/css
using the port, so it was not matter that I published my WebServerResources on my WebServer because the URL's were relative to the root path of TOMCAT.

Then I found that TOMCAT has the ROOT folder inside the webapps folder and it works like the WebServer's Root Directory, so anything you put there you can access it using URL's like this 

http://mySite:myTomcatPort/myResourse, example (http://localhost:8080/myPage.html)

So, It is just necessary to create the WebObjects folder inside the TOMCAT's ROOT folder and a folder for each project you deploy on it, and obviously create the Contents/WebServerResources structure inside the project's folder.

It also works for Frameworks, just create the directory Frameworks inside the WebObjects folder and a folder for each Framework's WebServerResourses you want to publish, and finally copy the WebServerResources of the framework to its folder.


Hope this results helpful for some one. 


_______________________________
Ing. Miguel Angel Torres Avila




 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >TOMCAT deployment + WebServerResources (From: Miguel Angel Torres Avila <email@hidden>)

  • Prev by Date: TOMCAT deployment + WebServerResources
  • Next by Date: Re: Memory Management
  • Previous by thread: TOMCAT deployment + WebServerResources
  • Next by thread: WebServices question
  • Index(es):
    • Date
    • Thread