wood burning stoves
The moose likes JSP and the fly likes asp to jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "asp to jsp" Watch "asp to jsp" New topic

asp to jsp

alec stewart stewart
Ranch Hand

Joined: Dec 23, 2003
Posts: 71
how do i write the following code in jsp.i mean to say that can anyone give me the equivalent code for jsp:
<% Response.ContentType ="text/xml" %>
<?xml version="1.0" ?>
dim xmldoc
dim root
dim onode
set xmldoc=Server.CreateObject("Microsoft.XMLDOM")
if xmldoc.childNodes.length=0 then
set root=xmldoc.createnode("element","CUSTOMERDEF","")
set conn=Server.CreateObject("ADODB.Connection")
conn.Open "Provider=SQLOLEDB;Initial Catalog=school;Data Source=ddixit;UID=sa"
sql="select country_id,country_value from country"
set rs=conn.Execute(sql)
while (not rs.EOF)
set onode=xmldoc.CreateNode("element","CUSTOMER","")
for i=0 to rs.fields.count-1
if rs.fields(i).name=country_id then
set child=xmldoc.createNode("element",rs.fields(i).Name,"")
end if
end if
xmldoc.Save(Server.MapPath("customer.xml") )
Varun Khanna
Ranch Hand

Joined: May 30, 2002
Posts: 1400
(Assuming that you know an ASP)
If I give you a JSP can you convert it into an ASP?

- Varun
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63548

Perhaps the best approach would be to take a stab it and to ask questions about any portions that have you bamboozled.
[ February 26, 2004: Message edited by: Bear Bibeault ]

[Asking smart questions] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63548

Also, when posting code please be sure to use the UBB code tags so that the original formatting of the code is perserved.
Consider Paul's rocket mass heater.
subject: asp to jsp
It's not a secret anymore!