Académique Documents
Professionnel Documents
Culture Documents
Courses (/courses) Help (/help) About (/about) Blog (http://ed-blog.mongodb.com/) DMAKETAS (/DASHBOARD)
SEARCH
If everything is working properly, you should be able to start the blog by typing:
m v nc o m p i l ee x e c : j a v aD e x e c . m a i n C l a s s = c o u r s e . B l o g C o n t r o l l e r
If you goto http://localhost:8082 (http://localhost:8082/) you should see a message this is a placeholder for the blog Here are some URLs that must work when you are done.
h t t p : / / l o c a l h o s t : 8 0 8 2 / s i g n u p h t t p : / / l o c a l h o s t : 8 0 8 2 / l o g i n h t t p : / / l o c a l h o s t : 8 0 8 2 / l o g o u t
When you login or sign-up, the blog will redirect to http://localhost:8082/welcome and that must work properly, welcoming the user by username We have removed four Java statements from UserDAO and marked the areas where you need to work with XXX. You should not need to touch any other code. The java statements that you are going to add will add a new user upon sign-up and validate a login by retrieving the right user document. The blog stores its data in the blog database in two collections, users and sessions. Here are two example docs for a username erlichson with password fubar. You can insert these if you like, but you dont need to.
>d b . u s e r s . f i n d ( ) {" _ i d ":" e r l i c h s o n " ," p a s s w o r d ":" V H 9 I F u + / v U N S K T z Z s F Z E O s K 1 , 1 9 2 4 2 6 1 3 3 0 "} >
Once you have the the project working, the following steps should work: go to http://localhost:8082/signup create a user It should redirect you to the welcome page and say: welcome username, where username is the user you signed up with. Now Goto http://localhost:8082/logout Now login http://localhost:8082/login.
Ok, now its time to validate you got it all working. There was one additional program that should have been downloaded in the project called validate.py.
p y t h o nv a l i d a t e . p y
If you got it right, it will provide a validation code for you to enter into the box below. Enter just the code, no spaces. Notes on validation The Python validation script requires the following python modules be installed on your computer: pymongo, urllib, urllib2, and cookielib. A typical Python installation will already have most of these installed except pymongo. If you have python-setuptools installed, the command "easy_install" makes this simple. Any other missing packages will show up when validate.py is run, and can be installed in a similar fashion.
$e a s y _ i n s t a l lp y m o n g o
Alternative Java-based Validation We also have an alternative validation program written in Java. If you are having trouble getting the Python one to work due to issues with your Python installation, you can try this. Start by downloading Validate.zip (/static/m101j-october2013/handouts/Validate.609667b39521.zip) into a directory. Now cd to that directory and issue the following command
j a v aj a rV a l i d a t e . j a r
HIDE ANSWER
Products & Services (http://www.mongodb.com/products/mongodb) Events (http://www.mongodb.com/events) Partners (http://www.mongodb.com/partners) Customers (http://www.mongodb.com/customers) About MongoDB (http://www.mongodb.com/about) Contact Us (/contact) Careers (http://www.mongodb.com/careers)
(https://twitter.com/mongodbinc)
(http://www.facebook.com/mongodb)
(http://www.linkedin.com/company/783611)