We're using IBM RAD for development and IBM Websphere Application Server as our web app server here at work. Give these constraints, would it still be possible to develop and deploy Angular SPAs? Like install a Typescript plugin for RAD probably, but how will you deploy it to WAS if there are no EAR files generated?
You'll need to create a web module (if you haven't already) and package the result of the Angular build (the contents of the dist/ directory, by default in Angular 2) into the root of your web module, so that it can be served as static content. In Eclipse, the contents of the WebContent folder are placed in the root of the war. Then let RAD package up your web module into a war and possibly ear and deploy it.
That web module should have the following in web.xml in your web module, in order to allow deep links to be redirected back to the SPA so the router can route them properly:
<error-page>
<error-code>404</error-code>
<location>/</location>
</error-page>
Related
Questions was asked in interview that can we deploy jar on tomcat?
My answer was no, so counter was why like so.
Kindly help
Thanks in advance
To deploy it succesfully, you have to create a war file instead of a jar. See the differences:
jar (Java archive) contains libraries, resources a accessories files.
war (Web archive) contains the web application deployable on any servlet/server
ear (Enterprise archive) is all above can be packaged deployed on any server/servlet as well
I don't know the background of your development. In case you use Maven, just change the packaging.
<project>
<groupId>com.example</groupId>
<artifactId>exampleProject</artifactId>
<packaging>war</packaging>
<version>1</version>
....
</project>
In the interview you'd simply answer that the purpose of jar is not to be deployed on Tomcat. There is war for it. Moreover war contains the web-content like HTML, CSS, JavaScript, JSP, images etc..
you can not deploy jar in a stand alone Tomcat container, but it is possible to deploy web application as executable jar in embedded Tomcat (example - using Spring boot with embedded tomcat as container)
I'm trying to deploy .EAR on Liferay (running on JBoss), I put .EAR to JBoss deployments folder. My structure is:
lib (some libraries/modules)
META-INF
WAR (it contains all Liferay specific libraries from auto deploy)
JAR
According to console, deploy is correct. JAR is running (I have some methods with Timers and they are working properly). But I don't see any portlets from WAR that I can add, but according to console WAR is deployed. They are simply not exposed to Liferay. I know that the .EAR is like a closed structure.
I am wondering how to make portlets available to Liferay?
I would appreciate any ideas, thank you.
Currently there is no standard way to deploy portlets (WAR) inside EAR. Liferay won't detect them. Your WAR with portlets must be deployed separately.
I try to deploy webproject which do not have web.xml and WEB-INF, and fully configured using spring mvc java configuration. .war file works perfectly on local machine in tomcat 7. But when I put war on the openshift application using winscp and then trying to connect to it, I get throws 404 notfaund response. Maybe someone can explain me what can be wrong. Also I use html not jsp for web content.
Should I install additionaly java to application?
Should projects be always configured with web.xml?
You can either deploy war or can add project folder like:
$TOMCAT_HOM/your-project-directory/.html,.jsp/WEB-INF/class (all java files) and WEB-INF/lib (your all jars) + WEB-INF/web.xml
make sure java is installed and all variable sets on the system
you must add all your java files in web.xml
I build restful web service using maven on Eclipse and test with embedded server. All of this succeeds, now I want to deploy on a standalone Jetty server.
I was able to get Jetty running but when I go http://host:8080/my-war-file/ I see only directory with META-INF and WEB-INF, which Jetty thinks are both empty.
I do not believe there is a problem with my war file
/my-war-file
/META-INF
/WEB-INF
/classes
/lib
web.xml
How can I access resource classes through browser running Jetty standalone?
As per the Google tutorial, I have developed the basic StockWatcher application, that makes an RPC call to the server, which sends some data, which is displayed on the client.
I now want to deploy it in Tomcat, such that if call something like localhost/StockWatcher, I should get the same experience as when running the app from GWT in development mode.
How do I do this? There is a similar topic here, but I couldn't much understand it. If I only copy the compiled war folder, what happens to the GreetingServiceImpl class which handles the RPC? And how do I do the mapping such that localhost/StockWatcher maps to localhost:8080 (something like Mod_Rewrite)?
Steps to deploy war on TOMCAT
1)Compile you gwt web application
2)Copy the war file
3)Add all libraries(jar files) in lib folder of war file
4)Rename your war as "myapp"
5)create a .war file with that "myapp" folder
6)start tomcat with catalina.bat run.
For step5 (generating .war file ):Preparing .war file from command line
Normally if you deploy well your war directory and you are able to start tomcat you have done everything. If you access your page using this url : localhost:8080/StockWatcher gwt will know that it must use that url as a baseURL for all gwt/rpc requests.
To generate the war using Eclipse : right click on the project -> export -> war. You will have the war exported with all the dependencies inside. just unzip it in the ROOT directory