Maven Command Line org.joda.time.LocalTime

Maven COMMAND LINE Quick Reference:


Lets say your class is located in:
C:/PRJ_ROOT/classes/hello/HelloWorld.class
And that your HelloWorld.java package declaration was:
package hello;


Compile, package, and run, if you have NO library dependencies:
SOURCES:
COMPILE: https://spring.io/guides/gs/maven/
RUN: https://www.youtube.com/watch?v=20U2aLtWYu8&list=PLN4rUakF78aB0dpR0_ngbldjzcC6qsXRt
cd C:/PRJ_ROOT
mvn compile
mvn package
cd C:/PRJ_ROOT/classes/
java -cp . hello.HelloWorld
//NOTE: Directory is NOT C:/PRJ_ROOT/classes/hello because
//We need to have cd point to root of where package starts.

//IF YOU HAVE DEPENDENCIES in your project, running this way will NOT work
//Well, it could if you hand-paste the .jar files you need into the class folder.
But that defeats the point of maven being a build tool if you are going to do something manual like that.

The example at: https://spring.io/guides/gs/maven/
That uses: import org.joda.time.LocalTime;
Will not run using:
java -cp . hello.HelloWorld


Run maven build when you have library dependencies:
SOURCE: http://www.vineetmanohar.com/2009/11/3-ways-to-run-java-main-from-maven/
Step1: Move project root on command line:
I.g: cd C:/PRJ_ROOT

Step2: Choose how you would like to run:
Without arguments:
mvn exec:java -Dexec.mainClass=”hello.HelloWorld”

With arguments:
mvn exec:java -Dexec.mainClass=”hello.HelloWorld” -Dexec.args=”arg0 arg1 arg2″

With runtime dependencies in the CLASSPATH:
mvn exec:java -Dexec.mainClass=”hello.HelloWorld” -Dexec.classpathScope=runtime

Spring MVC Controllers are singletons

Spring MVC Controllers are singletons
http://stackoverflow.com/questions/11508405/are-spring-mvc-controllers-singletons

This means, I can’t store session/state information in them…
How do I do that? I am about to give up and do a JAVASCRIPT front end
for now…

Confirming that spring MVC controllers are singletons:
What do you do when you have more than one user on them?
http://stackoverflow.com/questions/15836136/more-than-one-user-in-the-same-controller-spring-mvc

Server vs Servlet?

http://stackoverflow.com/questions/5039354/difference-between-an-application-server-and-a-servlet-container

this is interesting:
http://stackoverflow.com/questions/4965914/java-jsp-vs-servlet
In MVC, Jsp acts and a view and a servlet acts as a controller.
JSP can run JavaScript.
(So JSP + AJAX == YES??)

in short: servlets should be used if you have more java than HTML and JSP should be used if you have more HTML than java

A JSP technically gets converted to a servlet but it looks more like PHP files where you embed the java into HTML.

is very common to combine servlets and JSP so that the initial request gets sent to a servlet which does some java work and then forwards it to a JSP which actually makes the HTML output.

A Servlet is mainly used to extend the functionality of server while JSP serve as the view.

This also:
http://www.differencebetween.net/technology/difference-between-jsp-and-servlet/

Question: Do servlets run on the same server?

Smack A UI onto an existing application:

Maybe via using a view resolver?
http://examples.javacodegeeks.com/enterprise-java/spring/mvc/spring-mvc-view-resolver-example/

Is there a simpler way for now?

Here is the question I want, with some valid answers, but none of them using spring MVC:
http://stackoverflow.com/questions/1557954/how-do-you-add-gui-to-this-java-program
Uses SWING components. Looks like it could be practical.

This uses WindowBuilder / SWT. And does what I’d like I think.
Java #E3: Creating a GUI with Eclipse

This looks like a Java Applet. No go with that.

Unfortunately, this uses ANGULAR. But also uses spring:
Multiple UI Applications and a Gateway: Single Page Application with Spring and Angular JS Part VI
https://spring.io/blog/2015/03/23/multiple-ui-applications-and-a-gateway-single-page-application-with-spring-and-angular-js-part-vi

Adding GUI to existing console program. (What I need)
http://stackoverflow.com/questions/23068745/adding-a-gui-to-existing-java-console-based-program
Looks like I need to research writing event listeners?

Writing Event listeners:
http://docs.oracle.com/javase/tutorial/uiswing/events/index.html
http://docs.oracle.com/javase/tutorial/uiswing/events/generalrules.html

Swing Tutorials:
http://docs.oracle.com/javase/tutorial/uiswing/

Swing however looks like it is applet/desktop based… We want something browser based.
http://stackoverflow.com/questions/14979140/swing-application-on-web-browser

Maybe figure out how to hook a .JSP page into the console program?

…Servlets are… .JSP files??
https://www.mulesoft.com/tcat/tomcat-jsp

Use existing web service in .JSP Page

http://docs.oracle.com/cd/E13226_01/workshop/docs81/doc/en/core/index.html
Tells me the web service needs a WSDL file.
That I can click on and do RightClick –> Generate JCX

What I think I need:
make ajax call to existing web service, eclipse
JAX-WS:
http://blog.sortedset.com/step-by-step-web-services-with-tomcat-tomee-apache-cxf-eclipse/

Java Spring: Getting started making a rest service:
http://spring.io/guides/tutorials/bookmarks/

I actually want to use pre-existing service…

Not quite what I want:
Spring MVC 4.0: Consuming RESTFul Web Services using RestTemplate
http://www.programming-free.com/2014/04/spring-mvc-consuming-restful-web-services.html

Maybe I need to look into SPRING MVC UI components?
http://stackoverflow.com/questions/7520490/spring-mvc-ui-components <<no luck here.

My story needs to be simplified….
Just smack a UI onto the existing recruiter-client and candidate-clients.

Before you bounce, mail to yourself.

It was a lot of work to get to this step. Partially because I’ve never done this before and I had
to think of how I was going to do it.

Making note of the calls I used:
//first call posts a message. Tags who it is from, and who it is to.
//second call gets a message. To get the message, you need to identify who you are
//and who the message is from.
http://localhost:8080/boxpost?to=RecipientMan&from=SenderMan&msg=hellothere
http://localhost:8080/boxget?to=RecipientMan&from=SenderMan

Basically, the gauntlet will communicate via RESTFul get api like this.
Using a “PO Box” method. This is 1 way communication. But should be enough
for the testing application. After I finish this project, learning about sockets would be good.