Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How do I call aspx from a servlet?

 
Janel Blakely
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there a way to call an ASPX page in a servlet and pass data from the ASPX to servlet?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64607
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You mean besides a link to an ASP page?
 
Janel Blakely
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know. I am very new to .NET programming and don't know Java. I have to update existing Java servlet code to set a variable that I can get from aspx code. We have several applications that were developed in Java to run in Oracle WebCenter portal that now need to run as webparts in MOSS. MOSS does not have a Java API. The only item the portlets need to work in MOSS is the current portal logged in user. I have aspx code that gets the current MOSS logged in user. Need to call the ASPX page in a servlet and get the username from the ASPX.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64607
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you need to "call" (poor choice of words) an ASP page under Java code control, you'll need to issue an HTTP request to the ASP page. You can pass data to the page via request parameters on the query string. The classes in java.net can help you, or you can use a higher level library such a HttpClient.

Data is passed back from the ASP page in the response.
 
Janel Blakely
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Everywhere I have researched, I cannot find how to set the Response parameter in the aspx, in fact several discussions stated that you cannot do it. So, I went down another route and found javascript code that gets the MOSS username, but can't figure out to set the servlet variable = javascript variable.
 
Madhan Sundararajan Devaki
Ranch Hand
Posts: 312
Java MS IE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please pass the javascript variable as one of the query string parameters when calling the Servlet. Using the Servlet API
<code>
request.getParameter( <Parameter Name> );
</code>
you should be able to fetch the value in the Servlet.
 
Ulf Dittmer
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Janel Blakely wrote:Everywhere I have researched, I cannot find how to set the Response parameter in the aspx, in fact several discussions stated that you cannot do it. So, I went down another route and found javascript code that gets the MOSS username, but can't figure out to set the servlet variable = javascript variable.

What is a "response parameter"? Requests can have parameters in the URL, but responses don't. Is this an ASPX concept?

Mentioning JavaScript is confusing. So you're not implementing something along the lines of what Bear mentioned, which would be servlet --(HTTP request)--> ASPX resource --(HTTP response)--> servlet, but something that involves the client side?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic