java - How do I use Jetty to host multiple web apps? -


i have following assignment need program using jetty. i've done bit of research how jetty works can't understand how can have 2 applications running @ once, below says need have 2 forms of url: /student , /course.

i made simple web server before using com.sun.net.httpserver.httpserver host page multiple contexts (different pages based on different urls) i'm not sure how emulate same behavior in jetty. want use multiple handlers, or single handler multiple contexts? how implement multiple handlers or contexts? every example i've seen seems allow use of 1 context or 1 handler.

i'm not worried right logic of program. don't understand how separate logic 2 accessible web apps. what type of object need use host multiple apps in 1 program?


write web application using jetty framework implements following functionality. alternative web frameworks can used permission of instructor (i provide signed permission note, if approved).

the application should allow creation , editing student profile, url should start /student. additionaly application should allow display of sections course taught (similar assignment 3). this url courses should start courses. these 2 features independent.

the student page should provide form register student, registered student must supply name, student number, , contact information. contact information should include mailing address, , email address. page must support creation , editing of student's profile. once profile created, system must able edit fields. should use fake data testing.

the student's profile must saved disk. can serialize java class contains information , write file. file should consulted page loaded browser.

the form data student page should sent server using json. contents of form should fetch server json message.

the student form application can implemented using 1 web page javascript handling form data sent , received using json. assignment must contain javascript code.

the url application should start /course. courses page should provide form course text field, number text field, , submit button. once submitted server should provide list of sections course, or error message if course not exist.

in jetty (and every other servlet engine), deploy different web archives (.war files) web server.

with jetty did creating 2 applications , name them according url, e.g. student.war , course.war these .war files placed in $jetty_home/webapps directory.

btw: if start jee , servlet engines, should start simple application become familiar it.


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -