0

zk with jetty embedded

asked 2013-08-29 17:06:48 +0800

azure313 gravatar image azure313
1

HI,

I'm making a project using zk with jetty embedded. After a few day research, i can't make it run.

I'm using Netbean, jetty 8 and zk 7.

If anyone have simple exam for render simple zk view on jetty embedded, please show me.

Thank a lot.

delete flag offensive retag edit

Comments

Is this a Maven Project or Simple Web Module Because Jetty is not the Standard Server .

sjoshi ( 2013-08-30 05:41:25 +0800 )edit

3 Answers

Sort by » oldest newest most voted
0

answered 2014-03-25 18:19:15 +0800

JonS gravatar image JonS
1

Hi asure313

Did you get the above to work (using WebAppContext)? If so could you provide a detailed example ?

Thanks

link publish delete flag offensive edit

Comments

Maybe this is what you need - I just found it: http://pineapplesoftware.blogspot.com/2012/02/how-to-make-standalone-web-application.html

JonS ( 2014-03-25 18:21:52 +0800 )edit
0

answered 2013-09-03 04:15:15 +0800

azure313 gravatar image azure313
1

Thank you, good solution Dis.

But, instead of deploy the war file, can i use WebAppContext and setDescriptor to the web.xml? This is my try follow the instruction on jetty page:

Server server = new Server(9090);

WebAppContext context = new WebAppContext();
context.setDescriptor("./zk5/web/WEB-INF/web.xml");
context.setResourceBase("./zk5/web/");
context.setContextPath("/");
context.setParentLoaderPriority(true);
server.setHandler(context);

server.start();
server.join();
link publish delete flag offensive edit
0

answered 2013-09-02 11:19:32 +0800

dis gravatar image dis flag of Switzerland
140 4

Hi

We also run our ZK application in an embedded jetty. We did the following:

  1. Write the ZK based web application and generate a war file (which can run actually in any web app container)
  2. Write a Java Class with a main() method. In the main() create the Jetty server, the WebAppContext and deploy the war file from 1. with the org.eclipse.jetty.webapp.WebAppContext.setWar method.
  3. Start the Jetty server

Regards, dis

link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2013-08-29 17:06:48 +0800

Seen: 59 times

Last updated: Mar 25 '14

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More