473,569 Members | 2,611 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1653
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.GetByt es(postData);

// Prepare web request...
HttpWebRequest myRequest =
(HttpWebRequest )WebRequest.Cre ate("https://www.xxx.co.nz/
xxxWeb/login.jsp");
myRequest.Metho d = "POST";
myRequest.Allow AutoRedirect = false;
myRequest.KeepA live = true;
myRequest.Cooki eContainer = cookieContainer ;
myRequest.Conte ntType = "applicatio n/x-www-form-urlencoded";
myRequest.Conte ntLength = data.Length;
Stream newStream = myRequest.GetRe questStream();
// Send the data.
newStream.Write (data, 0, data.Length);
newStream.Close ();

HttpWebResponse res =
(HttpWebRespons e)myRequest.Get Response();

// Then grab the content of the desired page
myRequest = (HttpWebRequest )HttpWebRequest .Create("http://
www.xxx.co.nz/xxxWeb/index.jsp?vgnex t=123&vgnextf=C at");
myRequest.Cooki eContainer = cookieContainer ;
myRequest.Timeo ut = 20000;
myRequest.Crede ntials = CredentialCache .DefaultCredent ials;
res = (HttpWebRespons e)myRequest.Get Response();
StreamReader sr = new StreamReader(re s.GetResponseSt ream());
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.GetByt es(postData);

// Prepare web request...
HttpWebRequest myRequest =
(HttpWebRequest )WebRequest.Cre ate("https://www.xxx.co.nz/
xxxWeb/login.jsp");
myRequest.Metho d = "POST";
myRequest.Allow AutoRedirect = false;
myRequest.KeepA live = true;
myRequest.Cooki eContainer = cookieContainer ;
myRequest.Conte ntType = "applicatio n/x-www-form-urlencoded";
myRequest.Conte ntLength = data.Length;
Stream newStream = myRequest.GetRe questStream();
// Send the data.
newStream.Write (data, 0, data.Length);
newStream.Close ();

HttpWebResponse res =
(HttpWebRespons e)myRequest.Get Response();

// Then grab the content of the desired page
myRequest = (HttpWebRequest )HttpWebRequest .Create("http://www.xxx.co.nz/xxxWeb/index.jsp?vgnex t=123&vgnextf=C at");
myRequest.Cooki eContainer = cookieContainer ;
myRequest.Timeo ut = 20000;
myRequest.Crede ntials = CredentialCache .DefaultCredent ials;
res = (HttpWebRespons e)myRequest.Get Response();
StreamReader sr = new StreamReader(re s.GetResponseSt ream());
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.GetByt es(postData);
// Prepare web request...
HttpWebRequest myRequest =
(HttpWebRequest )WebRequest.Cre ate("https://www.xxx.co.nz/
xxxWeb/login.jsp");
myRequest.Metho d = "POST";
myRequest.Allow AutoRedirect = false;
myRequest.KeepA live = true;
myRequest.Cooki eContainer = cookieContainer ;
myRequest.Conte ntType = "applicatio n/x-www-form-urlencoded";
myRequest.Conte ntLength = data.Length;
Stream newStream = myRequest.GetRe questStream();
// Send the data.
newStream.Write (data, 0, data.Length);
newStream.Close ();
HttpWebResponse res =
(HttpWebRespons e)myRequest.Get Response();
// Then grab the content of the desired page
myRequest = (HttpWebRequest )HttpWebRequest .Create("http://www.xxx.co.nz/xxxWeb/index.jsp?vgnex t=123&vgnextf=C at");
myRequest.Cooki eContainer = cookieContainer ;
myRequest.Timeo ut = 20000;
myRequest.Crede ntials = CredentialCache .DefaultCredent ials;
res = (HttpWebRespons e)myRequest.Get Response();
StreamReader sr = new StreamReader(re s.GetResponseSt ream());
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
4416
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 Gal
4
1968
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 file, and then process each XML file to generate separate language-variant XHTML files? For example, say we have a file foo.xml which contains,...
0
1082
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 styelvision tool by applying a xslt transformation to xml i.e i want to generate the xslt file through sytlevision UI. Can this be done? Anyone...
4
1967
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 handle on how close XML is to replacing HTML for browsing specifically (I am aware of its other benefits.) Also I do understand that XML can be...
0
1160
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
2260
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 be a series of static html pages. I will keep all the data locally and would generate the required pages and upload them whenever I needed to. I do...
4
2475
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? Havent found anything in google. Thanks Andi
3
1750
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 client-side or server-side wasn't an issue. Recently I've been overhauling the code in order to pass transform to the client wherever possible, and I've...
1
2550
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, ' ', '')"/> …. This works fine with command line msxsl and XML editors like XMLSpy. However, if you use .NET's
0
7615
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8130
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7677
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7979
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6284
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5514
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5219
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3643
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2115
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.