Help coderanch get a
new server
by contributing to the fundraiser

K Riaz

Ranch Hand
+ Follow
since Jan 08, 2005
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by K Riaz

Originally posted by AMR OMAR:
how can acsses portlet directly from another server and show information
from portal for example in normal web application we can acsses any jsp file
like that www.myserver\.....\any.jsp directly how can make this issue with
portal ...?

Portlets are not tied to URLs. You cannot provide a link to a specific portlet - if you could, it wouldn't be a portlet. If you wish to obtain some data from another server (e.g. weather info for your portal), then you would implement a portlet which would establish some sort of a connection to the remove server, pull data from it and render it within a portlet.
[ January 03, 2006: Message edited by: K Riaz ]
18 years ago
How do I call a function within the 'value' attribute of an input tag?


<input type="text" value="'return myValue()'"/>

This doesn't seem to work. The myValue() function returns a string which should be the input's value. How can it be done?
That sounds like a question about the IBM Portal as I found nothing in the JSR-168 spec. This forum is for JSR-168 discussion, not proprietary APIs. Can you imagine the Servlet forum discussing Servlets from different APIs? Chaos would follow.
18 years ago

Originally posted by Janhavi Namshikar:

Totally agree on this, England don't deserve the second seeding.
Surprising to see the Netherlands not getting the seeding


Why not? The seedings were based on the performances over the last two World Cups, and if you know *anything* about football, you will know that England did well in both, hence their higher seeding, as opposed to Holland, who did not even qualify for the last World Cup in Japan & South Korea.

RE: The Draw
I watched it live on the BBC (as did 350m people in 190 countries), it was great to see some great legends (Pele et al). How complicated was the FIFA arithmetric in deciding the groups?! I think if England are to win it, they will need to beat at least two of: Germany, Brazil and/or Argentina - they always end up loosing to one of these teams ('86 - Argentina, '90 - Germany, '98 - Argentina, '02 - Brazil). They should make the quarter finals at least, although a meeting with Germany will be interesting in Round 2 if England win their group and Germany finished 2nd (or vice versa).

The Argentina/Holland game should be a great game.

Can't wait until the 9th of June next year!
18 years ago

Originally posted by robbie keane:
When my portal gets loaded (has 4 protlets), it takes ages to come up.

Enable caching in your portlets to avoid the render() method from being fired everytime any portlet loads or refreshes (as a consequence of a POST request from another portlet). In the portlet.xml file, add a <expiration-cache> value. This is the number of seconds after which the content of the portlet "the view" is considered stale. Remember, the portlet container will not fire the render() of the portlet until after the cache expires.
18 years ago
Use the PortletRequestDispatcher and supply it the page after some logic to determine whether the user has logged in or not.

[ December 10, 2005: Message edited by: K Riaz ]
[ December 10, 2005: Message edited by: K Riaz ]
18 years ago
If you wish to pass parameters within a URL, for example, "user=bob", then you simply create an Action URL (which will cause the portlets processAction() method to fire) and invoke "setParameter(key, value)" on it.

An example,

Create your ActionURL object as you would do so normally.

ActionURL myURL = renderResponse.createActionURL();

then add your parameters,

myURL.setParameter("user", "bob");

Now all you need to do is to simply place myURL into your <a> tag.

<a href="<%=myURL.toString()%>">Click Me</a>

Do not try to append parameters manually to the myURL object, as each portlet container has its own implementation of reading in custom parameters, and it will not recognise custom parameters this way.
[ December 10, 2005: Message edited by: K Riaz ]
18 years ago

Originally posted by Jessica Sant:
Inter Portlet Communication is not covered by the JSR-168 spec,

Actually, it is, although it is not done so explicitly. It can be done by setting session variables with the APPLICATION_SCOPE flag, which makes data available to other portlets in the same portal. By default, all session variables are set with a PORTLET_SCOPE flag, so by writing something like session.setAttribute("key", "value") means that you can access "value" only within the portlet of which it is defined in. But if you add write session.setAttribute("key", "value", APPLICATION_SCOPE), you can retrieve it from another portlet, which is useful for passing data between portlets.
18 years ago
Stay away from IBM's Portal. It is not JSR-168, so you're learning a proprietary API.
18 years ago
The API does not have such a method. Although it doesn't make sense, as you deal with portlets, not servlets tied to a URL which a client can request (a portlet is not mapped to a URI, so you do not gain anything even if you could decode the actual HTTP request method).
18 years ago
Can't help with your question, but I am interested in this:

Originally posted by kailash thiyagarajan:
temp to perm contractor

What is a "perm(anent) contractor"? Unless I have missed something, the terms are mutually exclusive.
18 years ago
The session information is not being lost.

You are currently retrieving a normal servlet session from within your JSP, so you cannot find the username attribute within it.

Use "renderRequest.getPortletSession().getAttribute("username")" to retrieve portlet sessions. Objects "request" and "session" do not refer to portlets.
18 years ago

Originally posted by Peter Rooke:

Just hope that England don't end up in the same group as the bloody German team

That is unlikely as both teams will probably be seeded, and all seeded teams avoid each other during the group stages.
18 years ago

You could watch a film trailer at, they usually offer alternative streams depending on the capabilities of your ADSL line. Failing that, do what most people do with their ADSL lines, play online games or download stuff off P2P.

P.S. Out of interest, which ISP are you with/what package did you get? I'm currently with Pipex (1Mb/256Kb) paying �23.44/month for uncapped access. I'm thinking of migrating to another ISP as I only average around 2Gb of data transfer a month. Any recommendations?
[ November 20, 2005: Message edited by: K Riaz ]
18 years ago

What is the best way to dynamically inform the render methods about a different JSP page to use for a particular request? For example, depending on some logic in processRequest(), I might want to forward a user to "/test1.jsp" or "/test2.jsp". This is determined in processRequest(..), but the request dispatcher in the render methods need to know the destination. What would be the best way to inform it? The only (unelegant) solution I can think of is to set an attribute in the request with the destination in processRequest(), and then read it in render().

Can anyone think of a better way? I thought about using a private instance variable (set by processRequest, read by render), but this would probably have ramifications in a multi-threaded environment.

18 years ago