File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Variable Syntax Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Variable Syntax" Watch "Variable Syntax" New topic
Author

Variable Syntax

Alice Huber
Greenhorn

Joined: May 09, 2010
Posts: 9

I wish to give name attribute of <input> tag as variable depending on value of i. Kindly guide for the syntax.



Thanks
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
You need to add double quotes around +varfld+ .
Alice Huber
Greenhorn

Joined: May 09, 2010
Posts: 9
Tim,

Double quotes around +varfld+ does not resolve the issue.



Html code generated out of above code in Servlet is as below -



Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
I said "double quotes", not "escaped double quotes" - which renders them inoperable.
Alice Huber
Greenhorn

Joined: May 09, 2010
Posts: 9
Thanks Tim. Below code worked out.



Html Ouput is :
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19693
    
  20

Slightly better is escaped double quotes and non-escaped double quotes:
The output will then also have quotes around the name attribute value.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Variable Syntax