Location of web resources in HTML5 + REST project? - eclipse

I am learning HTML5 integration with REST web services.
Using information mentioned at URL:
Redhat tutorial for HTML5 app
I created sample application in my eclipse workspace. Generated code structure is as shown below:
I do not understand why all web resources are stored are shown as a deployed resources? Does not it mean that, they are not part of my source code? I thought there would WEB-INF directory, under which my web resources will be stored. Please correct my understanding.

I found that it is just the way eclipse displays the structure of workspace. But in actual file system, web resources are stored under:
src/main/webapp

Related

Where do I place my templates for Blog-related mail notifications in Liferay 7.0?

The documentation states that I can configure the liferay server to use my own templates for the email messages. Specifically, if I add these properties to a portal-ext-env.properties in $CATALINA_BASE/conf/liferay:
blogs.email.entry.added.enabled=true
blogs.email.entry.added.subject=${resource:com/liferay/portlet/blogs/dependencies/email_entry_added_subject.tmpl}
blogs.email.entry.added.body=${resource:com/liferay/portlet/blogs/dependencies/email_entry_added_body.tmpl}
Liferay will supposedly use the templates in the specified paths (com/liferay/portlet/blogs/dependencies/email_entry_added_subject.tmpl and com/liferay/portlet/blogs/dependencies/email_entry_added_body.tmpl). The thing is, it's not very clear what these paths are relative to. Are these files relative to $CATALINA_BASE? For example, would the above configuration result in Liferay looking up $CATALINA_BASE/com/liferay/portlet/blogs/dependencies/email_entry_added_body.tmpl for creating the body of an email message? If this is not the case, where does Liferay lookup templates for Blog-related email messages?
After some digging, I've found that you place the templates in the $CATALINA_BASE/webapps/ROOT/WEB-INF/classes folder. Paths that you reference in the properties (e.g. blogs.email.entry.added.body=${resource:com/liferay/portlet/blogs/dependencies/email_entry_added_body.tmpl}) are relative to the aforementioned classes folder.
So, if I wanted Liferay to use a template file in the ff. relative path: org/foo/my_email_entry_added_body.tmpl, I would do two things:
Place the file in $CATALINA_BASE/webapps/ROOT/WEB-INF/classes/org/foo/my_email_entry_added_body.tmpl.
Add the following line to $CATALINA_BASE/portal-ext-env.properties: blogs.email.entry.added.body=${resource:org/foo/my_email_entry_added_body.tmpl}.
I consulted my co-worker and got a better understanding of why this is. The architecture of a Liferay application is such that it comes bundled with a Tomcat server. According to the documentation, WEB-INF/classes is a directory that a web app deployed to a Tomcat server looks up for classes and resources:
A class loader is created for each web application that is deployed in a single Tomcat instance. All unpacked classes and resources in the /WEB-INF/classes directory of your web application, plus classes and resources in JAR files under the /WEB-INF/lib directory of your web application, are made visible to this web application, but not to other ones.
Specifically, this folder is high in priorty in the web app's classpath.
When you see Liferay code similar to ${resource:path/to/foo}, it's looking up resources in its classpath. One of the paths in that classpath is WEB-INF/classes. Hence, if path/to/foo is placed in WEB-INF/classes, Liferay will find path/to/foo there.

Deploy OpenUI5 on phoenixframework

I created my first openui5 hello world application on eclipse and want to deploy on my phoenix(elixir webserver) server.
Application structure:
And the app looks as follow:
My question is, how make the application ready to deploy?
Its all static content. Copy all files and folders inside Webcontent to your web server. You can put it to the web servers root, but you don't have to. WEB-INF and META-INF are not needed.
Then copy the openui5 framework to the Webserver to a folder of your choice. You may have to change the bootstrap element to point to your sap-ui-core.js.
That's it. Optionally You can use the grunt-openui5 plugin to build a packaged preload file of your application.

hosting a GWT application on private machine

I have a GWT application for some highcharts visualizations, that accesses Cassandra database in the back end. Obviously, because of privacy of data in the database I can not host the application on Google App Engine.
This application being a private one which is used by very few people, I dont expect lot of traffic.So, I was thinking of hosting the application on my own machine.
Please some one tell me is it good idea?, and how to go about implementing that.
Thanks..
It is not a problem at all, just set up some application server, like Tomcat, compile your gwt project, and export the war folder to the Tomcats webapps folder. Your war contents should have following structure (or similar):
project_name.war
- css
- images
- WEB-INF
- gwt compiled_javascript folder
- index.html

How-to deploy to application server web project with non-webproject structure (within Eclipse)

Basically what I want is to deploy from Eclipse web project to application server (WebLogic). The problem is that project source files are structured differently than what application server expects (i.e. there is no WEB-INF containing deployment descriptor). As a results when I try to deploy my project to app server it is not recognized as deployable app. Is there a smart and elegant way how-to solve this problem?
OK, i will answer my question myself. Basically this situation can be solved by creating a new dynamic web project with the required structure and then using Linked folder functionality of eclipse.

Place GWT application on Jetty

Can someone help me to place my GWT application on Jetty. I am not using maven. I have libraries in my build path.
First I am taking the war folder already exploded and copy it in jetty/webapps, then in folder context.
I have placed a folde named BiddingSystem in folder web apps, it is an already exploded folder and not a .war file
In folder jetty/context, there is a file test.xml
I am renaming the file to BiddingSystem.xml
and also editing content of BiddingSystem.xml, finally the content of BiddingSystem.xml is
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
<configure class="org.mortbay.jetty.webapp.WebAppContext">
<set name="contextPath">/BiddingSystem</set>
<set name="war"><systemproperty name="jetty.home" default="."/>/webapps/BiddingSystem</set>
</configure>
I am getting this error:
to deploy GWT app on Jetty, you often do not need to configure anything.
Copy your 'war' folder (which is created in your eclipse project by GWT) to JETTY_HOME\webapps
change the name 'war' to anything you like for examples "StockWatcher" so you will have JETTY_HOME\webapps\StockWatcher. Now start jetty server and try http://localhost:8080/StockWatcher on your Chrome :)
When GWT is compiled it creates just javascript and html (plus resources like css/jpg/etc..). GWT jars and your Java classes are only used during build process and NOT needed during deployment.
So, you just need to copy contents of you /war directory to your Jetty deployment directory.
There is a .html file which is called host page. It links to all other javascript and css pages needed. This is the entry point to your app. Just open this page in your browser.
It seems that you are new to GWT so there are a few basic things you need to know:
GWT is a client-side technology. You write Java code which is compiled to javascript that then runs inside browser. In this sense GWT is more related to javascript libraries (jQuery,..) than classic page-by-page web frameworks (jsf, Ror, php).
GWT app runs inside a single HTML page (called a host page). This page ever reloads. Look at Gmail to see how this works (though Gmail itself is not written in GWT) .
GWT is NOT a server side technology. You can use any technology on the server side (php, RoR, anything) that supports REST.
GWT can talk to server via AJAX. The data exchange format can be JSON or XML. Backend can be any technology that can produce REST-style JSON or XML content. If you have Java backend you can use GWT-RPC which adds some more capabilities over AJAX/JSON.