Ram Charan

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

Recent posts by Ram Charan

Hi All,

I have JSP's which displays around hundred amount and percentage fields (which could be null or empty). I have used JSTL fmt and custom tags to format number and apply the patterns accordingly. Now considering performance is it a better approach to surround the value with JSTL core tag(<c:if>) to check if value is not empty and then include the JSTL fmt tag?

I see that JSTL fmt tag checks if value is not null and then only applies formatting, but it also evaluates other attribute values provided in the tag using ExpressionEvaluator though the value is evaluated to null.

Please provide your comments and best practices if any.

Thanks & Regards,
Ram Charan
12 years ago
JSP

Campbell Ritchie wrote:

Victor Ramen wrote:I think I know which IT company you are talking of . . .

. . . but please continue to keep quiet; as you already know, we don't discuss particular companies on this forum.



So Campbell, where did Victor mention about specific IT company name?

Request you to please be respectful to others

Regards,
Ram Charan
13 years ago
@Devaka

Request you to understand the importance of the query than worrying about the subject line.

Regards,
Ram Charan
13 years ago
Hello All,

I am currently working with one of the top Indian IT company and has over 5years of experience in Java/J2EE. Also I have onsite experience (USA) of around 2 years. Due to low salary in my current company I have started attending interviews. Now I got an offer with one of the worlds largest financial services firm with very good package. (10 LPA Fixed+ Bonus of upto 20% of fixed salary)INR in my preferred location i.e. Hyderabad, India and they have mentioned that there will not be any onsite.

My current employer is now offering an onsite opportunity of minimum 12 months to retain. Now I am a bit confused on what to choose i.e. considering the pay going onsite I can save 100% more than what I save in India after changing the job but in terms of opportunity not sure if I will get the same again after I return with such a pay in Hyderabad, India location.

Request you guys to please provide some inputs from your experiences.

Regards,
Ram Charan
13 years ago
That's true. Struts1 action classes are not thread safe. You have to write thread safe action classes(Have only constants as instance variables).
13 years ago
If you are trying to provide the user the same data if he opens a new tab and data should not get messed up then you should synchronize session. Though it might effect performance but you have to live with it. HttpSession is not threadsafe.

Thanks,
Ram.
13 years ago
Mahesh,

In simple terms class implementing ServletContextListener interface acts link a main method to the web application i.e. for example using a context parameter value you want to construct an object and set in context scope then this is the best one to use.

Servlet init method will be called when the container creates an instance of the servlet. So ideally here you should have servlet initialization code here.

Thanks,
Ram.
13 years ago
Thanks Ankur for your response.

But I am using IBM RAD to generate portlet class which creates the class extending AbstractPortlet and implementing ActionListener. In this I cannot find processAction method to override. So how can I implement the scenario in question?

Ram
14 years ago
Hi,

I am new to the portlets development using IBM Websphere. The scenario I have is on a portlet user provides some information and clicks on submit which needs to be be saved in session and should be redirected to a diferent page. Can some one help me on where the action processing needs to be done and how the redirection can be acheived? My portlet class is extending AbstractPortlet and implementing ActionListener.

If I am not wrong, in JSR 168 compliant portal this will be done in processAction method and page redirection cane be done using response.sendRedirect in the same method.

Thanks,
Ram.
14 years ago
Sorry, my mistake. Thanks Tim, working perfectly fine now.

Regards,
Ram Charan
Thanks swapnl. I followed the link, but facing an issue while testing sample code. Below is the code I am testing with javascript enabled

<html>
<head>
<script language="javascript" type="text/javascript">
document.getElementById("jseblock1").style.display="block";
</script>
</head>
<div id="jseblock1" style="display: none">

This is the block with javascript enabled.


</div>
</html>

The issue is, statement document.getElementById("jseblock1").style.display="block"; is not getting called even if javascript is enabled. Am I doing anything wrong here? Please help.

Thanks,
Ram Charan

May be, but it gives a wierd user experience as it reloads the page again. Any other approaches?

Thanks,
Ram Charan
Hi,

I have a home page page formed by three jsp's i.e. header, content and footer. There are two different content jsp's whose inclusion needs to be determined based on the browser javascript enabled/disabled at runtime. Please let me know how this can be achevied.

I tried using jQuery Ajax by making a synchronous call to set a request attribute and read it, but it did not help.

Thanks
Ram charan
Hi All,
I have developed struts portlets in different wars on liferay using bridges and life ray out of box struts. But its behavior is different from JSR168 specification. If a struts protlet is developed within the liferay project then it closely matches with JSR 168 spec. I tried to develop struts portlets in different war using completely liferay out of the box struts but running into configuration issues. My query is can we achieve this or do we have use only bridges or mix of both to match the behavior of the struts portlet with a JSR 168 compliant portlet.

Thanks and Regards,
Ram.
15 years ago
Hi All,
I have developed a struts portlet on liferay.

In Web.xml I am including
<servlet>
<servlet-name>ChangePassword</servlet-name>
<servlet-class>com.liferay.portal.kernel.servlet.PortletServlet
</servlet-class>
<init-param>
<param-name>portlet-class</param-name>
<param-value>com.liferay.portlet.StrutsPortlet</param-value>
</init-param>
<load-on-startup>0</load-on-startup>
</servlet>

<servlet-mapping>
<servlet-name>ChangePassword</servlet-name>
<url-pattern>/ChangePassword/*</url-pattern>
</servlet-mapping>

<servlet>
<servlet-name>PortletActionServlet</servlet-name>
<servlet-
class>com.liferay.util.bridges.struts.LiferayPortletServlet
</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
</servlet>

<servlet-mapping>
<servlet-name>PortletActionServlet</servlet-name>
<url-pattern>/portlet_action/*</url-pattern>
</servlet-mapping>


In portlet.xml i am including

<portlet>
<portlet-name>ChangePassword</portlet-name>
<display-name>Change Password</display-name>
<portlet-class>com.liferay.portlet.StrutsPortlet</portlet-class>
<init-param>
<name>ViewPage</name>
<value>/portlet_action/changepassword/action</value>
</init-param>
<resource-bundle>com.liferay.portlet.StrutsResourceBundle</resource-
bundle>
<expiration-cache>300</expiration-cache>
<supports>
<mime-type>text/html</mime-type>
</supports>
</portlet>


when tried to run I am getting the below exception

Uncaught exception thrown in one of the service methods of the servlet: ChangePassword. Exception thrown : java.lang.NullPointerException
at com.liferay.portlet.StrutsPortlet.include(StrutsPortlet.java:224)
at com.liferay.portlet.StrutsPortlet.doView(StrutsPortlet.java:195)
at com.liferay.portal.kernel.portlet.LiferayPortlet.doDispatch(LiferayPortlet.java:51)
at javax.portlet.GenericPortlet.render(GenericPortlet.java:163)
at com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServlet.java:102)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:989)


My action class is extending com.liferay.portal.struts.PortletAction.

Let me know if I have to make any configuration changes. Thanks in Advance.

Regards,
Ram.
15 years ago