Hi,
I am using windows Livesite 3.0.2.I have created one Controller class.I am calling the controller class from content xml
apperance xsl
Parameter1
Parameter2
controller class
package com.interwoven.livesite.runtime.controller.impl;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import com.interwoven.livesite.runtime.RequestContext;
import com.interwoven.livesite.common.web.ForwardAction;
import com.interwoven.livesite.common.web.URLRedirectForwardAction;
import com.interwoven.livesite.common.util.Hashtable;
import com.interwoven.livesite.common.web.StopForwardAction;
import com.interwoven.livesite.common.web.URLRedirectForwardAction;
public class SampleTask
{
/**
* method that preforms a redirect
*
*
@Param context runtime context
*
@return forward action
*/
public ForwardAction methodRedirect(RequestContext context)
{
System.out.println("redirect url");
return new URLRedirectForwardAction(context,
context.getParameterString("redirectUrl"));
}
/**
* Override output
*
*
@Param context runtime context
*
@return forward action
*
@throws IOException write exception
*/
public ForwardAction methodOutput(RequestContext context) throws
IOException
{
System.out.println("mthod output---");
ServletOutputStream output = context.getResponse().getOutputStream();
context.getResponse().setContentType("text/html");
context.getResponse().setStatus(HttpServletResponse.SC_OK);
output.print("Output overridden, have a niceday.");
output.flush();
return new StopForwardAction();
}
/**
* non-redirect work task
*
*
@Param context runtime context
*
@return forward action
*/
public ForwardAction methodOne(RequestContext context)
{
System.out.println("methodOne called.");
return null;
}
/**
* non-redirect work task that uses component parameters
*
*
@Param context runtime context
*
@return forward action
*/
public ForwardAction methodTwo(RequestContext context)
{
System.out.println("method two----");
String p1 = context.getParameterString("parameter1");
String p2 = context.getParameterString("parameter2");
System.out.println("methodTwo called with '"+p1+"' and '"+p2+"'");
return null;
}
}
but my controller is not getting invoked. i have attached my content.xml Thanks in advance