Solved

Passing Date objcet as parameter

Posted on 2003-11-16
4
219 Views
Last Modified: 2010-04-01
Hello,

How to pass a date object as a parameter between two jsp pages

Thanks in advance

Regards

-Dipali
0
Comment
Question by:dipjsp
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 15

Accepted Solution

by:
dualsoul earned 63 total points
ID: 9762018
you can use:

    request.setAttribute("Attribute name" , yourObject); //sets the object for request

, you can retrive it the same way:

     Object yourObject=request.getAttribute("Attribut name");

, or you can store your object in session, if you want, the methods are absolutely the same as i've shown above.
 
0
 
LVL 14

Assisted Solution

by:kennethxu
kennethxu earned 62 total points
ID: 9764958
if you need to pass them as url parameter, you can make user of SimpleDataFormat object:

java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat( "yyyyMMdd" );

then construct the url as
page.jsp?mydate=<%=sdf.format( myDate ) %>

you can then retrieve it as parameter in page.jsp as:

String strMyDate = request.getParameter( "mydate" );
// you need to check for null.
java.util.Date date = sdf.parse( strMyDate );
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
java cyclic graphs 15 221
project group option in netbeans equivalent term in eclipse 1 52
login form jsp example 2 50
difference between sorce folder and folder in eclipise 3 44
Original post  on Monitis Blog. Web performance monitoring is broken into two camps: passive and active. Passive monitoring is defined as looking at real-world historical performance by monitoring actual log-ins, site hits, clicks, requests for…
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question