Hi,
Is it possible to convert the following JSP code to ASP.NET? - <%--
-
-
-
Exactly 2 parameters need to be set
-
1) format
-
2) filename
-
-
--%>
-
-
<%@page import="java.io.*,java.net.URLDecoder,emaxon.formats.MolImporter,emaxon.struc.Molecule"%>
-
<%
-
try {
-
// Retrieving GET/POST parameters
-
String format = request.getParameter("format");
-
if(format == null) {
-
throw new Exception("Format needs to be specified.");
-
}
-
String filename = null;
-
String molstring = null;
-
if((filename = request.getParameter("file")) == null) {
-
if((molstring = request.getParameter("mol")) == null) {
-
throw new Exception("Structure needs to be specified.");
-
}
-
}
-
-
// Setting content type
-
String type = format.indexOf(":") == -1 ?
-
format : format.substring(0, format.indexOf(":"));
-
response.setContentType("image/" + type);
-
-
// Creating the molecule
-
Molecule mol = null;
-
if(molstring == null) {
-
// Reading the file
-
File f = new File(filename);
-
MolImporter mi = new MolImporter(f,"");
-
mol = mi.read();
-
} else {
-
// Reading the posted SMILES string
-
mol = MolImporter.importMol(molstring);
-
}
-
-
// Calculate the coordinates if needed (for example
-
// if the input is SMILES)
-
if(mol.getDim()==0) {
-
mol.clean(2, "O1");
-
}
-
-
// Generating the image
-
byte[] b = mol.toBinFormat(format);
-
ServletOutputStream outs = response.getOutputStream();
-
outs.flush();
-
outs.write(b,0,b.length);
-
outs.close();
-
} catch(Throwable t) {
-
t.printStackTrace();
-
}
-
%>
3 1330
Hi,
Is it possible to convert the following JSP code to ASP.NET? - <%--
-
-
-
Exactly 2 parameters need to be set
-
1) format
-
2) filename
-
-
--%>
-
-
<%@page import="java.io.*,java.net.URLDecoder,emaxon.formats.MolImporter,emaxon.struc.Molecule"%>
-
<%
-
try {
-
// Retrieving GET/POST parameters
-
String format = request.getParameter("format");
-
if(format == null) {
-
throw new Exception("Format needs to be specified.");
-
}
-
String filename = null;
-
String molstring = null;
-
if((filename = request.getParameter("file")) == null) {
-
if((molstring = request.getParameter("mol")) == null) {
-
throw new Exception("Structure needs to be specified.");
-
}
-
}
-
-
// Setting content type
-
String type = format.indexOf(":") == -1 ?
-
format : format.substring(0, format.indexOf(":"));
-
response.setContentType("image/" + type);
-
-
// Creating the molecule
-
Molecule mol = null;
-
if(molstring == null) {
-
// Reading the file
-
File f = new File(filename);
-
MolImporter mi = new MolImporter(f,"");
-
mol = mi.read();
-
} else {
-
// Reading the posted SMILES string
-
mol = MolImporter.importMol(molstring);
-
}
-
-
// Calculate the coordinates if needed (for example
-
// if the input is SMILES)
-
if(mol.getDim()==0) {
-
mol.clean(2, "O1");
-
}
-
-
// Generating the image
-
byte[] b = mol.toBinFormat(format);
-
ServletOutputStream outs = response.getOutputStream();
-
outs.flush();
-
outs.write(b,0,b.length);
-
outs.close();
-
} catch(Throwable t) {
-
t.printStackTrace();
-
}
-
%>
It is possible to achieve the same functionality in ASP.NET. What you need to do is write down your program logic in pseude code then try try to write the ASP code for it.
It is possible to achieve the same functionality in ASP.NET. What you need to do is write down your program logic in pseude code then try try to write the ASP code for it.
I simply need to convert the above jsp script to asp. I am not familiar with JSP syntax which is why i am unable to convert the logic my self.
Does anybody have the microsoft java language conversion assistant tool to convert the above code for me? I know its available to download for free but i need visual studio 2005 package to run it!
I simply need to convert the above jsp script to asp. I am not familiar with JSP syntax which is why i am unable to convert the logic my self.
Does anybody have the microsoft java language conversion assistant tool to convert the above code for me? I know its available to download for free but i need visual studio 2005 package to run it!
Oh, so you don't want to write the code but want to use a software package to convert the codes? Maybe someone else will help you then. I prefer helping those actually writing the code.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Mohammed Mazid |
last post by:
Hi folks!
Can anyone please help me with this?
I am developing a Quiz program but I am stuck with "multiple answers".
Basically I need some sort of code that would select multiple answers...
|
by: Mohammed Mazid |
last post by:
Hi folks!
Can anyone please help me with this?
I am developing a Quiz program but I am stuck with "multiple answers".
Basically I need some sort of code that would select multiple answers...
|
by: Dave H |
last post by:
Hello,
I have a query regarding definition lists. Is it good practice
semantically to use the dt and dd elements to mark up questions and
answers in a frequently asked questions list, or FAQ?
...
|
by: Nigel Molesworth |
last post by:
I've Googled, but can't find what I need, perhaps I asking the wrong
question!
I want a "FAQ" page on a web site, I hate those pages that scroll you to
the answer so and I figured that a good...
|
by: amelia170 |
last post by:
I am creating a database with a yes or no answer for question 1.
Based on that answer, (if they answer yes) they will answer question
2, then three....However, if they answer no to question one, I...
|
by: Peter Mount |
last post by:
Hello
I'm having trouble with " scanf("%c", &answer);" on line 20 below. When I
run the program in cygwin on Windows 98SE it skips that line completely and
ends the program. Does scanf have...
|
by: Bernie Yaeger |
last post by:
I asked two fairly simple questions, or so I thought, but have received no
ideas at all.
1. What is the control that MS uses in Outlook Express that contains
attachments? It appears to be a...
|
by: windsorben |
last post by:
I'd like to have an image appear after the student answers each short answer question correctly. I can't seem to get it to work properly. See code below.
Thanks!
<html>
<head>...
|
by: Ken Fine |
last post by:
I want to add the security question and answer security feature to the
ChangePassword control. I am aware that this functionality is built into the
PasswordRecovery tool. I have implemented the...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |