Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

How do I call aspx from a servlet?

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Sheriff
Posts: 67634
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 67634
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 312
MS IE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Rancher
Posts: 43027
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
She's brilliant. She can see what can be and is not limited to what is. And she knows this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic