Translate jsp pages into asp pages using xslt

A

ak

Hi Guys,

I was just wondering whether it is possible to translate JSP pages
into ASP pages using XSLT.

What I want is to be able to open a currently available website
developed in JSP in a blackberry. Considering the limited real estate
of blackberry, we would like to propose a translation of the websites
using ASP .NET and XSLT by stripping out the HTML response from the
JSP pages.

Do you think it is possible?

Regards,
Andie
 
N

nahid

Hi Guys,

I was just wondering whether it is possible to translate JSP pages
into ASP pages using XSLT.

What I want is to be able to open a currently available website
developed in JSP in a blackberry. Considering the limited real estate
of blackberry, we would like to propose a translation of the websites
using ASP .NET and XSLT by stripping out the HTML response from the
JSP pages.

Do you think it is possible?

Regards,
Andie

It depends on your page structure. What's the condition of java script
and event subscription....at the end I think you can't get any benefit
if u considered effort?
 
A

ak

It depends on your page structure. What's the condition of java script
and event subscription....at the end I think you can't get any benefit
if u considered effort?

Hi Nahid,

Most of the pages will be hardcoded (e.g. menus). The pages that
require translation are login screen and the product catalogue. All of
the menu will be hardcoded. There won't be any java script on the
product catalagoue (e.g. normal html tables).

One issue that require my thinking cap on is the login. I was just
wondering how ASP handles JSP sessions.

Thanks for your quick reply.

Andie
 
H

Hans Kesting

One issue that require my thinking cap on is the login. I was just
wondering how ASP handles JSP sessions.

I take it that that Blackberry will point to the asp.net site. That asp.net
site
will then (from codebehind) call the jsp site, using WebRequest.

In this case your codebehind is the "browser" that accesses the jsp site.
A "session" for a browser is just a (session-)cookie.
You need to set up a (single) CookieContainer that you attach to
every HttpWebRequest.


Hans Kesting
 
M

Masudur

I take it that that Blackberry will point to the asp.net site. That asp.net
site
will then (from codebehind) call the jsp site, using WebRequest.

In this case your codebehind is the "browser" that accesses the jsp site.
A "session" for a browser is just a (session-)cookie.
You need to set up a (single) CookieContainer that you attach to
every HttpWebRequest.

Hans Kesting

Hi Andie
check out this post
http://www.thescripts.com/forum/thread334654.html
 
A

ak

I take it that that Blackberry will point to the asp.net site. That asp.net
site
will then (from codebehind) call the jsp site, using WebRequest.

In this case your codebehind is the "browser" that accesses the jsp site.
A "session" for a browser is just a (session-)cookie.
You need to set up a (single) CookieContainer that you attach to
every HttpWebRequest.

Hans Kesting

That's what I am looking for.

Thanks Hans. I will give it a try and let you know the outcome.

Kind Regards,
Andie
 
A

ak

That's what I am looking for.

Thanks Hans. I will give it a try and let you know the outcome.

Kind Regards,
Andie

Hi Again,

I used the cookiecontainer as suggested by Hans. However, i still
could not receive the data that is supposed to be available only when
we are logged in to the site. Can someone help me with this? Here is
some snippets of my code:

CookieContainer cookieContainer = new CookieContainer();
ASCIIEncoding encoding = new ASCIIEncoding();
string postData = "username=xxxx";
postData += "&password=yyyy";
byte[] data = encoding.GetBytes(postData);

// Prepare web request...
HttpWebRequest myRequest =
(HttpWebRequest)WebRequest.Create("https://www.xxx.co.nz/
xxxWeb/login.jsp");
myRequest.Method = "POST";
myRequest.AllowAutoRedirect = false;
myRequest.KeepAlive = true;
myRequest.CookieContainer = cookieContainer;
myRequest.ContentType = "application/x-www-form-urlencoded";
myRequest.ContentLength = data.Length;
Stream newStream = myRequest.GetRequestStream();
// Send the data.
newStream.Write(data, 0, data.Length);
newStream.Close();

HttpWebResponse res =
(HttpWebResponse)myRequest.GetResponse();

// Then grab the content of the desired page
myRequest = (HttpWebRequest)HttpWebRequest.Create("http://
www.xxx.co.nz/xxxWeb/index.jsp?vgnext=123&vgnextf=Cat");
myRequest.CookieContainer = cookieContainer;
myRequest.Timeout = 20000;
myRequest.Credentials = CredentialCache.DefaultCredentials;
res = (HttpWebResponse)myRequest.GetResponse();
StreamReader sr = new StreamReader(res.GetResponseStream());
String string1 = sr.ReadToEnd();
TextBox1.Text = string1;

Kind Regards,
Andie
 
A

ak

On Jun 27, 5:55 pm, Hans Kesting <[email protected]>
wrote:
That's what I am looking for.
Thanks Hans. I will give it a try and let you know the outcome.
Kind Regards,
Andie

Hi Again,

I used the cookiecontainer as suggested by Hans. However, i still
could not receive the data that is supposed to be available only when
we are logged in to the site. Can someone help me with this? Here is
some snippets of my code:

CookieContainer cookieContainer = new CookieContainer();
ASCIIEncoding encoding = new ASCIIEncoding();
string postData = "username=xxxx";
postData += "&password=yyyy";
byte[] data = encoding.GetBytes(postData);

// Prepare web request...
HttpWebRequest myRequest =
(HttpWebRequest)WebRequest.Create("https://www.xxx.co.nz/
xxxWeb/login.jsp");
myRequest.Method = "POST";
myRequest.AllowAutoRedirect = false;
myRequest.KeepAlive = true;
myRequest.CookieContainer = cookieContainer;
myRequest.ContentType = "application/x-www-form-urlencoded";
myRequest.ContentLength = data.Length;
Stream newStream = myRequest.GetRequestStream();
// Send the data.
newStream.Write(data, 0, data.Length);
newStream.Close();

HttpWebResponse res =
(HttpWebResponse)myRequest.GetResponse();

// Then grab the content of the desired page
myRequest = (HttpWebRequest)HttpWebRequest.Create("http://www.xxx.co.nz/xxxWeb/index.jsp?vgnext=123&vgnextf=Cat");
myRequest.CookieContainer = cookieContainer;
myRequest.Timeout = 20000;
myRequest.Credentials = CredentialCache.DefaultCredentials;
res = (HttpWebResponse)myRequest.GetResponse();
StreamReader sr = new StreamReader(res.GetResponseStream());
String string1 = sr.ReadToEnd();
TextBox1.Text = string1;

Kind Regards,
Andie

Hi Guys,

I am still not able to login properly.

However, I have tried posting some data using the same technique. I
can retrieve the expected response.

Can someone advise me whether it is possible to log in into a
different web server to retrieve member-only contents or not?

Kind Regards,
Andie
 
A

ak

Hi Again,
I used the cookiecontainer as suggested by Hans. However, i still
could not receive the data that is supposed to be available only when
we are logged in to the site. Can someone help me with this? Here is
some snippets of my code:
CookieContainer cookieContainer = new CookieContainer();
ASCIIEncoding encoding = new ASCIIEncoding();
string postData = "username=xxxx";
postData += "&password=yyyy";
byte[] data = encoding.GetBytes(postData);
// Prepare web request...
HttpWebRequest myRequest =
(HttpWebRequest)WebRequest.Create("https://www.xxx.co.nz/
xxxWeb/login.jsp");
myRequest.Method = "POST";
myRequest.AllowAutoRedirect = false;
myRequest.KeepAlive = true;
myRequest.CookieContainer = cookieContainer;
myRequest.ContentType = "application/x-www-form-urlencoded";
myRequest.ContentLength = data.Length;
Stream newStream = myRequest.GetRequestStream();
// Send the data.
newStream.Write(data, 0, data.Length);
newStream.Close();
HttpWebResponse res =
(HttpWebResponse)myRequest.GetResponse();
// Then grab the content of the desired page
myRequest = (HttpWebRequest)HttpWebRequest.Create("http://www.xxx.co.nz/xxxWeb/index.jsp?vgnext=123&vgnextf=Cat");
myRequest.CookieContainer = cookieContainer;
myRequest.Timeout = 20000;
myRequest.Credentials = CredentialCache.DefaultCredentials;
res = (HttpWebResponse)myRequest.GetResponse();
StreamReader sr = new StreamReader(res.GetResponseStream());
String string1 = sr.ReadToEnd();
TextBox1.Text = string1;
Kind Regards,
Andie

Hi Guys,

I am still not able to login properly.

However, I have tried posting some data using the same technique. I
can retrieve the expected response.

Can someone advise me whether it is possible to log in into a
different web server to retrieve member-only contents or not?

Kind Regards,
Andie

Hi,

I have resolved this issue.

The problem happened because the login page uses an image button. And,
I did not realize that for posting an image button, you need to
include the coordinates of the mouse.

Regards,
Andie
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top