Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7615907
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T02:45:31+00:00 2026-05-31T02:45:31+00:00

In Liferay 6.1 The class ServletResponseUtil has been moved to a different package than

  • 0

In Liferay 6.1 The class ServletResponseUtil has been moved to a different package than in Liferay 6.0:

//Liferay 6.0, 
// this class lives in util-java.jar in the default tomcat web app, /webapps/ROOT/lib. 
import com.liferay.util.servlet.ServletResponseUtil;

//Liferay 6.1
// class lives in portal-service.jar in  directory tomcat-7.../lib/ext/
//import com.liferay.portal.kernel.servlet.ServletResponseUtil;

The class is used in our code like this:

    String result = personComponentImpl.process(request); 
    response.setContentType("text/xml");

    try {
        ServletResponseUtil.write(response, result);
    }
    catch (Exception e) {
        if (_log.isWarnEnabled()) {
          _log.warn(e, e);
        }
    }

I have to maintain and improve a portlet that was written for the Liferay 6.0 release.
Now we are considering upgrading to 6.1, but during internal testing of the portlet I discovered that there are a few line of code where the above mentioned dependency is broken. There are ClassNotFoundExceptions on 6.1 at runtime.

My eclipse project is set up for 6.0 in mind.

What should I do now?:

  • Maintain two different branches of the portlet code. This is doable but might be too much effort in the long run

  • Maintain two different Eclipse projects with one code base, but with different build paths (this is only a general strategy, might not really work)

  • Include a clever hack in the java code, to build easily for 6.0, once for 6.1 (maybe a factory…this is only a vague idea)

  • Include a new ant task that builds + deploys for 6.1, although Eclipse is set up to build for 6.0

  • Remove the dependency on ServletResponseUtil class altogether, use another class that does the same as ServletResponseUtil.

  • Do something else

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T02:45:32+00:00Added an answer on May 31, 2026 at 2:45 am

    Since ServletResponseUtil is not much more than a 350 lines long, extremely verbose and even buggy implementation of response.getOutputStream().write(data);, I would opt for “use another class that does the same”.

    Perhaps you should combine that with a little “do something else” and never rely on the stability of the Liferay API.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So this all began in trying to get Coldfusion9 portlets to run under Liferay,
I have been having trouble deploying liferay portlets and themes from the command line
I am trying to use the library spring-json.1.3.1 in a project that has been
I've been using Liferay a lot for past 2 years, but I have never
I have a statement String pass = com.liferay.portal.util.PortalUtil.getUserPassword(renderRequest); that causes the following error in
Once you deployed liferay, how do you change the default home url? Standard is
I have this page in a Liferay 6.0.5 portal which contains of a looong
We have something called nested portlets in liferay. I want to add this portlet
Liferay 6.0.6, by default doesnt bundle with JBoss 7. Did anyone successfully get liferay
Liferay migration from one server to another help required. Can anyone share there steps

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.