Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Translate jsp pages into asp pages using xslt

Reply
Thread Tools

Translate jsp pages into asp pages using xslt

 
 
ak
Guest
Posts: n/a
 
      06-27-2007
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

 
Reply With Quote
 
 
 
 
nahid
Guest
Posts: n/a
 
      06-27-2007
On Jun 27, 11:06 am, ak <(E-Mail Removed)> wrote:
> 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?

 
Reply With Quote
 
 
 
 
ak
Guest
Posts: n/a
 
      06-27-2007
On Jun 27, 4:49 pm, nahid <(E-Mail Removed)> wrote:
> On Jun 27, 11:06 am, ak <(E-Mail Removed)> wrote:
>
> > 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

 
Reply With Quote
 
Hans Kesting
Guest
Posts: n/a
 
      06-27-2007
> On Jun 27, 4:49 pm, nahid <(E-Mail Removed)> wrote:
>
>> On Jun 27, 11:06 am, ak <(E-Mail Removed)> wrote:
>>
>>> 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


 
Reply With Quote
 
Masudur
Guest
Posts: n/a
 
      06-27-2007
On Jun 27, 1:55 pm, Hans Kesting <(E-Mail Removed)>
wrote:
> > On Jun 27, 4:49 pm, nahid <(E-Mail Removed)> wrote:

>
> >> On Jun 27, 11:06 am, ak <(E-Mail Removed)> wrote:

>
> >>> 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

 
Reply With Quote
 
ak
Guest
Posts: n/a
 
      06-27-2007
On Jun 27, 5:55 pm, Hans Kesting <(E-Mail Removed)>
wrote:
> > On Jun 27, 4:49 pm, nahid <(E-Mail Removed)> wrote:

>
> >> On Jun 27, 11:06 am, ak <(E-Mail Removed)> wrote:

>
> >>> 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

 
Reply With Quote
 
ak
Guest
Posts: n/a
 
      07-02-2007
On Jun 27, 11:36 pm, ak <(E-Mail Removed)> wrote:
> On Jun 27, 5:55 pm, Hans Kesting <(E-Mail Removed)>
> wrote:
>
>
>
> > > On Jun 27, 4:49 pm, nahid <(E-Mail Removed)> wrote:

>
> > >> On Jun 27, 11:06 am, ak <(E-Mail Removed)> wrote:

>
> > >>> 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

 
Reply With Quote
 
ak
Guest
Posts: n/a
 
      07-03-2007
On Jul 2, 10:56 pm, ak <(E-Mail Removed)> wrote:
> On Jun 27, 11:36 pm, ak <(E-Mail Removed)> wrote:
>
>
>
> > On Jun 27, 5:55 pm, Hans Kesting <(E-Mail Removed)>
> > wrote:

>
> > > > On Jun 27, 4:49 pm, nahid <(E-Mail Removed)> wrote:

>
> > > >> On Jun 27, 11:06 am, ak <(E-Mail Removed)> wrote:

>
> > > >>> 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

 
Reply With Quote
 
ak
Guest
Posts: n/a
 
      07-30-2007
On Jul 3, 3:45 pm, ak <(E-Mail Removed)> wrote:
> On Jul 2, 10:56 pm, ak <(E-Mail Removed)> wrote:
>
>
>
> > On Jun 27, 11:36 pm, ak <(E-Mail Removed)> wrote:

>
> > > On Jun 27, 5:55 pm, Hans Kesting <(E-Mail Removed)>
> > > wrote:

>
> > > > > On Jun 27, 4:49 pm, nahid <(E-Mail Removed)> wrote:

>
> > > > >> On Jun 27, 11:06 am, ak <(E-Mail Removed)> wrote:

>
> > > > >>> 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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[JSP] difference between jsp:forward and jsp:include alexjaquet@gmail.com Java 0 06-02-2006 01:21 PM
Multiple XSLT Transforms using a Controller XSLT sneill@mxlogic.com XML 2 10-19-2005 11:00 AM
translate this send into perl sfgroups@gmail.com Perl 1 03-16-2005 09:54 PM
translate a HTML document into a XHTML document mike Java 3 01-24-2005 09:42 AM
How to translate Japanese String into UTF-32 encoded using Java APIs ? Marat Java 5 11-10-2004 04:34 PM



Advertisments