• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Tim Cooke
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
Saloon Keepers:
  • Piet Souris
Bartenders:

java

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How to subtract date from date in java programming?
How to call a servlet through a servlet?
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Answers for your query is given below.
1> You can not conver date into date. For this you have get convert in to seconds, minutes, days, month or Year. And then you can minus the converted format.
For coversion of the date you can use date or dateFormat.
2> Calling a servlet page from another servlet is called redirection of a page. Here you can write code directly in to servlet. For this purpose you have to include HTML page in servlet or use redirect() method.
I hope your query is solved. For reference pl. use "SERVLET" book by "oreirly" publication.
Regards
Nikhil
[email protected]
------------------

[This message has been edited by Nikhil Chavan (edited February 09, 2001).]
[This message has been edited by Nikhil Chavan (edited February 09, 2001).]
 
mister krabs
Posts: 13974
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1) There's a couple of ways to do this. You can use the getTime() method which returns the Date object as a long. Do your arithmetic and use the result to create a new Date object. Or you can convert your Date objects to Calendar objects and use the add() method.
2) Use the RequestDispatcher interface. It has forward() and include() methods specifically for this purpose.
 
Sheriff
Posts: 7001
6
Eclipse IDE Python C++ Debian Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"bhawna",
The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at http://www.javaranch.com/name.jsp . We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Please choose a new name which meets the requirements.
Thanks.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic