473,399 Members | 3,302 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Translate jsp pages into asp pages using xslt

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

Jun 27 '07 #1
8 1642
On Jun 27, 11:06 am, ak <andiekurnia...@gmail.comwrote:
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?

Jun 27 '07 #2
ak
On Jun 27, 4:49 pm, nahid <nahid...@gmail.comwrote:
On Jun 27, 11:06 am, ak <andiekurnia...@gmail.comwrote:
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?
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

Jun 27 '07 #3
On Jun 27, 1:55 pm, Hans Kesting <news.2.han...@spamgourmet.com>
wrote:
On Jun 27, 4:49 pm, nahid <nahid...@gmail.comwrote:
On Jun 27, 11:06 am, ak <andiekurnia...@gmail.comwrote:
>Hi Guys,
>I was just wondering whether it is possible to translate JSP pages
into ASP pages using XSLT.
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
Hi Andie
check out this post
http://www.thescripts.com/forum/thread334654.html

Jun 27 '07 #4
On Jun 27, 4:49 pm, nahid <nahid...@gmail.comwrote:
>
>On Jun 27, 11:06 am, ak <andiekurnia...@gmail.comwrote:
>>Hi Guys,

I was just wondering whether it is possible to translate JSP pages
into ASP pages using XSLT.
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
Jun 27 '07 #5
ak
On Jun 27, 5:55 pm, Hans Kesting <news.2.han...@spamgourmet.com>
wrote:
On Jun 27, 4:49 pm, nahid <nahid...@gmail.comwrote:
On Jun 27, 11:06 am, ak <andiekurnia...@gmail.comwrote:
>Hi Guys,
>I was just wondering whether it is possible to translate JSP pages
into ASP pages using XSLT.
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
That's what I am looking for.

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

Kind Regards,
Andie

Jun 27 '07 #6
ak
On Jun 27, 11:36 pm, ak <andiekurnia...@gmail.comwrote:
On Jun 27, 5:55 pm, Hans Kesting <news.2.han...@spamgourmet.com>
wrote:
On Jun 27, 4:49 pm, nahid <nahid...@gmail.comwrote:
>On Jun 27, 11:06 am, ak <andiekurnia...@gmail.comwrote:
>>Hi Guys,
>>I was just wondering whether it is possible to translate JSP pages
>>into ASP pages using XSLT.
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

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

Jul 2 '07 #7
ak
On Jul 2, 10:56 pm, ak <andiekurnia...@gmail.comwrote:
On Jun 27, 11:36 pm, ak <andiekurnia...@gmail.comwrote:
On Jun 27, 5:55 pm, Hans Kesting <news.2.han...@spamgourmet.com>
wrote:
On Jun 27, 4:49 pm, nahid <nahid...@gmail.comwrote:
On Jun 27, 11:06 am, ak <andiekurnia...@gmail.comwrote:
>Hi Guys,
>I was just wondering whether it is possible to translate JSP pages
>into ASP pages using XSLT.
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
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

Jul 3 '07 #8
ak
On Jul 3, 3:45 pm, ak <andiekurnia...@gmail.comwrote:
On Jul 2, 10:56 pm, ak <andiekurnia...@gmail.comwrote:
On Jun 27, 11:36 pm, ak <andiekurnia...@gmail.comwrote:
On Jun 27, 5:55 pm, Hans Kesting <news.2.han...@spamgourmet.com>
wrote:
On Jun 27, 4:49 pm, nahid <nahid...@gmail.comwrote:
>On Jun 27, 11:06 am, ak <andiekurnia...@gmail.comwrote:
>>Hi Guys,
>>I was just wondering whether it is possible to translate JSP pages
>>into ASP pages using XSLT.
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
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
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

Jul 30 '07 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Chezy Gal | last post by:
Hi, I'm looking for java class programe which can translate from utf-8 to any iso-8859-x encoding. This java class will be called from my XSLT program, using DirXML environment. TIA, Chezy...
4
by: Tristan Miller | last post by:
Greetings. I would like to produce a static multilingual website in XHTML. Is it possible to specify each web page in its own XML file, but have all of the translations encapsulated in that one...
0
by: John Harkin | last post by:
Hi, Does Sytlevision support use of asp.net controls ? I need to produce asp.net compatible web pages using asp.net controls, i want these in generated html which i plan to generate through...
4
by: Pat | last post by:
Is anyone using XML instead of HTML for pages of content? If so is there a public site to browse? Can someone point me to a discussion of the pros and cons of doing this? I am trying to get a...
0
by: Stoggers | last post by:
Hi, Anyone got any examples of XSLT to translate a schema into another schema? I need to change the datatype on elements. Thanks, Stoggers.
2
by: Nick | last post by:
Hi all, I'm about to embark on a new project and can't decide quite how to do it. In summary, I have a database whose data I want to use to create html pages for a website. The website will just...
4
by: A.Hanemann | last post by:
Hi, i need a windows-Programm to translate many .XML-Files into .HTML and .PDF. I have the .DTD-File. The Programm should be easy to use and free. Does someone know where to find such a thing?...
3
by: Simon Brooke | last post by:
I've been doing XSL transforms, converting XML to HTML, server side since 2000. In those days, clients which could do the transformation client side didn't exist, so whether to transform...
1
by: =?Utf-8?B?R2F1cmF2?= | last post by:
Hi, I am using the Translate() function in one of the .XSLT file to remove the spaces, like this: <xsl:for-each select=".//Illustration"> <xsl:value-of select="translate(./@illusName, ' ',...
0
BarryA
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.