mamatachaudhari Newbie Poster

I have added a keypress event as

[CODE] jQuery('#body').keypress(function(){currentTime= new Date().getTime(); });[/CODE]

but when I open a pop up window which have a iframe contains a rich text area not capturing this event.

Any ways to handle parent event in child element?

Any suggestion?

hey you can use like this..

Properties props=new Properties();
FileInputStream fis = new FileInputStream (application.getRealPath("/WEB-INF/classes/"));

String componentList = props.getProperty("somekey");
FileOutputStream fos = new FileOutputStream (application.getRealPath("/WEB-INF/classes/"));


might be useful to u....

Is your application uses only JSP?
Otherwise u can use Ajax for this issue.

You can pass value to ajax request to populate another select box.

call a function on onchange event of first select box in that u can get
[CODE]var selectedvalue=document.getElementByName("evnt_cat").options[document.getElementByName("evnt_cat").options.selectedIndex].value;[/CODE]

then pass it to AJAX request.

You can declare id variable as global in init() method as call it onload of body tag
[CODE]function init()
id =0;

then append id to text box id property which u dynamically created.

Declare a combo Box of name fileNames. as

-Select- [/CODE] when You submit form you can use [CODE]function submit(form) { var newElem=""; for(int j=0;j

[QUOTE=amarjeetsingh;877260]Create the variable in the javaScript
and store the value in it
then use it

[code]function changeQuantity(form,productCode,index)
var z=productCode;
var y=index;

thanks.. Its working perfectly

[QUOTE=javaAddict;877479]What do you mean the list is nested?[/QUOTE]

list which i want to set to comboBox is in another arrayList
(arrayList within arrayList)

[QUOTE=adatapost;878069]You are adding reference of an object of a class which is not Serializable. Tomcat is trying to serialize the session, which
fails as soon as any non-serializable attribute is found.[/QUOTE]

What I do now?? Any change in web.xml? or server.xml?
I used pop3store class for attachment.

mamatachaudhari Newbie Poster

SEVERE: IOException while loading persisted sessions: writing aborted; com.sun.mail.pop3.POP3Message

I am not getting why this exception has occurred.It throws the exception when i starts tomcat server.
I have used recieve() method in LoginAction which is used to recieved mails using POP3 protocol.
I am using JAVAMAIL 1.4

[QUOTE]I am posting here my code which display pdf.
I m using struts 1.2 this method generate pdf.
I have used iText jar[/QUOTE]
public ActionForward print(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException {


/* set content type as PDF /


/* create Object Of document /

     Document document = new Document(PageSize.FLSE);
     /** set margin of page */
    document.setMargins(1.25F,0.75F, 5F,0.75F);

ByteArrayOutputStream baos = new ByteArrayOutputStream();

     PdfWriter pdfWriter=PdfWriter.getInstance(document, baos);;

/* Table For header address /

     PdfPTable headerTable =new PdfPTable(3);

     /** Add company Address*/ 

     /** First Cell  For address*/

     PdfPCell headerCell=new PdfPCell();
     headerCell.addElement(new Paragraph("My comapany"));

     /** add cell to headerTable*/


     /** Second cell For CompanyLogo */

     headerCell=new PdfPCell();
     /** get context object */

     ServletContext context=request.getSession().getServletContext();
     /** get Real  Path of image */ 

     String path=context.getRealPath(login.getPath());
     /** set image to cell*/

     Image img= Image.getInstance(path);

     /** add cell to headerTable*/


     /** Third cell for lable of document **/

     headerCell=new PdfPCell();
    String allLedger="ALL LEDGER";
    headerCell.addElement(new Paragraph(allLedger+"\n"
         +"From Date:"+session.getAttribute("firstDate")+"\nTo Date:"+session.getAttribute("lastDate")
         ,new Font(Font.TIMES_ROMAN, 10f, Font.BOLD, )));

     /** add cell to headerTable*/


/* add table to document /


/* Don't know why??/
/* comment it if u don't want to download pdf/
//response.addHeader("Content-Disposition", "attachment; filename=\"ledgers.pdf\"");

 /** get out put Stream*/
 out = response.getOutputStream();
 /** write to--- Don't know*/
/** Clear OutputStream*/

 }catch (Exception e) {
    System.err.println("exception in print=="+e.getMessage());

          return mapping.findForward("printJsp55");


It generate pdf whic u can use to print.
you can add your data to PdfPTable.
This ...

i got solution.I moved my java scrpit code to first Jsp (which i used to create tabs).

mamatachaudhari Newbie Poster

I m using struts 2.0 .
I want a comboBox() on Jsp.
bean i want to populate in combobox is nested.
I only know list property of
but my list is nested.
How can i populate combobox with nested

we cant convert jsp in to pdf .
you have to render the ur output in pdf format using iText.jar
search pdf using itext u will get ur solution

[QUOTE=adatapost;877203]Will you post javascript code?[/QUOTE]
I m giving just an alert("Hi" ) for checking prupose

function select(form)
alert("Hi") ;

[QUOTE=sanjayrawat177;872616]HEy Peter can you pls provide me the CODE ,i tried through itext but didnt get along..
so pls help buddy ...provide me the code to trnsfer JSP output in PDF[/QUOTE]

You can use PDFPtable for table formatting

[QUOTE=adatapost;877049]Post your code fragement in BB code. Check whether a select function is defined or not and if it there then post it so I can help you on that issue.[/QUOTE]

I have written that function on my tabbed jsp

[QUOTE=javaAddict;877050]What do you mean giving an alert. Post the code that works[/QUOTE]

This is my input text field

[code=JSP]<input type="text" id="productQuantity" size="5" onchange="changeQuantity(this.form,'','<%=z %>');"/>[/code]

And this is my javaScript function is..

[code=JavaScript]function changeQuantity(form,productCode,index)

after giving that alert messsage it works otherwise not.


r u using struts 1.2???
In struts 1.2 it will like this


[/code] here name might be your javabean property
mamatachaudhari Newbie Poster

I am using struts 2..
I want tabs on my jsp
and my code is..
On first Jsp i used to create tabs which works fine for me.




after executing navigateChangeTeamAction.action
now on my tabbed jsp code is as...

[code=JSP] <s:select name="teamEmpNameCombo"
listValue="employeeName" headerKey="1" headerValue="Select" multiple="true"
onchange="select(this.form);" theme="simple" >

but onchage javascript function select() not called. not giving any error.
if i put alert("Hi"); instead of select() it gives me alert message.

Please help me?? I don't know why my javascript function is not getting call??

[QUOTE=javaAddict;876440]Try this:

Thanks for reply....
It's not working..
when i first time load my project it gives me error like i is undefined
But after giving an alert it works fine...

mamatachaudhari Newbie Poster

I want to use a scriplet variable in javascript.
i used
<%! int i;>
<% i=0; %>
<input type="text" id="itemValue" onchange=changeValue('<%i%>')>

it works fine if i give alert(i) in
changeValue function.
Otherwise it gives error i is undefined.
Plz help me. I don't want to bother user by increasing one user click.
Plz help what is the reason ????

i m using struts 1.2