Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Using sendRedirect between 2 different packages

 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
alright so here are my 2 servlets. my login page is suppossed to redirect to the mynotes page after a successsful login. I use useresponse.sendRedirect("/Homework2/MyNotes"); in my login page at the bottom to try and accomplish that , but it doesnt work. my guess was because these belong to 2 different packages. which is homework1 and homework2. so my question is how can I map it so that my login page directs the user to the mynotes page? If i put Mynotes in my homework1 package , it works perfectly , so It has to be because its 2 different packages. but i have no idea how to make it work.

also , the error i get is HTTP Status 404 - /cs320stu38/Homework1/MyNotes

which means its still sending to the homework1 package , how can i change it so that its the homework2 package?



 
Marshal
Posts: 67451
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where are you putting your .class files?
 
John ortega
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Bear Bibeault wrote:Where are you putting your .class files?






cs320\workspace\cs320stu38\build\classes\cs320\Homework1\Login

cs320\workspace\cs320stu38\build\classes\cs320\Homework2\MyNotes
i think thats what you asked lol
 
Bear Bibeault
Marshal
Posts: 67451
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How are you running the servlets? Through an IDE?
 
John ortega
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Bear Bibeault wrote:How are you running the servlets? Through an IDE?




im using eclipse and running them on apache
 
Bear Bibeault
Marshal
Posts: 67451
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, I'll copy this to the IDEs forum. Running a web app from an IDE is its own ball of wax.
 
John ortega
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Bear Bibeault wrote:OK, I'll copy this to the IDEs forum. Running a web app from an IDE is its own ball of wax.



aaah sorry about that. thank you
 
Bear Bibeault
Marshal
Posts: 67451
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

John nava wrote:
aaah sorry about that. thank you


No problem.
 
He puts the "turd" in "saturday". Speaking of which, have you smelled this tiny ad?
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic