Problem in a filter request wrapper
Hi all:
I want to implement a filter that process the servlet request, then I was implement a filter and a class that extend the HttpServletRequestWrapper class. The problem is that when I class the doFilter method with my new class the server throw java.langClassCastException.
I don't know if I'm doing something wrong because there's a lot of references and examples to wrap the response but not so many to wrap the request.
I simplify the code to test what's the problem and this is my wrapper class and the relevant servlet code.
// Wrapper class public class CompressionServletRequestWrapper extends HttpServletRequestWrapper {
public CompressionServletRequestWrapper(HttpServletRequest request) throws IOException{ super(request); }
// Filter servlet CompressionServletRequestWrapper wrappedRequest =null;
boolean entradaComprimida=false; wrappedRequest=new CompressionServletRequestWrapper( httpRequest);
chain.doFilter(wrappedRequest, response);
I'm using Weblogic server 7.0 SP2
Best Regards
Miguel Angel
Thank you for your response.
This isn't my problem, before create the wrapper class I do a cast from ServletRequest:
HttpServletRequest httpRequest=(HttpServletRequest) request;
wrappedRequest=new CompressionServletRequestWrapper( httpRequest);
chain.doFilter(wrappedRequest, response);
And the exception is related with the wrapper class, it isn't with the ServletRequest. This is the expception:
java.lang.ClassCastException: com.logicFactory.ejemplo.filter.CompressionServletRequestWrapper
at weblogic.webservice.server.servlet.WebServiceServlet.getWebService(WebServiceServlet.java:187)
at weblogic.webservice.server.servlet.ServletBase.doGet(ServletBase.java:91)
at weblogic.webservice.server.servlet.WebServiceServlet.doGet(WebServiceServlet.java:224)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1058)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:401)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:20)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
at com.logicFactory.ejemplo.filter.GZIPFilter.doFilter(GZIPFilter.java:37)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:5451)
at weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManager.java:780)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3105)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2588)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:213)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:189)
Similar Messages
-
Filter request wrapper ClassCastException
Hi all:
I want to implement a filter that process the servlet request, then I was implement
a filter and a class that extend the HttpServletRequestWrapper class. The problem
is that when I class the doFilter method with my new class the server throw java.langClassCastException.
I don't know if I'm doing something wrong because there's a lot of references
and examples to wrap the response but not so many to wrap the request.
I simplify the code to test what's the problem and this is my wrapper class and
the relevant servlet code.
// Wrapper class
public class CompressionServletRequestWrapper extends HttpServletRequestWrapper
public CompressionServletRequestWrapper(HttpServletRequest request) throws
IOException{
super(request);
// Filter servlet
CompressionServletRequestWrapper wrappedRequest =null;
boolean entradaComprimida=false;
wrappedRequest=new CompressionServletRequestWrapper( httpRequest);
chain.doFilter(wrappedRequest, response);
Best Regards
Miguel Angel
I bet your consumer is a JSP, eh? I hear the wrappers work going to a
Servlet but not to a JSP (that gets turned into a Servlet when compiled...).
I tried a sample I found for the Response wrapper from a compression filter
This looks like it will do what you want to do....
http://www.orionserver.com/tutorials/filters/GZIPFilter.html
I want to make a filter that allows me to set/modify a Request Header (not a
Request Attribute nor a Response Header) and ran into the same issue, lots
of people saying "Use the HttpServletRequestWrapper" and "look at the
specs"; but no one with a code sample that actually WORKS!!!
Doris Chen from Sun just sent me this link to one of her code camps:
http://developer.java.sun.com/developer/onlineTraining/webcasts/35plus/dchen1/dchen1.html
and suggests Mary Hall's book "More Servlets and JavaServer Pages" (and the
filters section in Servlets2.3 spec too - figures...)
I haven't checked out the code camp nor the book yet. Post back if you
figure this out.
Thanks,
Michael J. Geiser
"Miguel Ángel" <[email protected]> wrote in message
news:[email protected]...
Hi all:
I want to implement a filter that process the servlet request, then I was
implement
a filter and a class that extend the HttpServletRequestWrapper class. The
problem
is that when I class the doFilter method with my new class the server throw
java.langClassCastException.
I don't know if I'm doing something wrong because there's a lot of
references
and examples to wrap the response but not so many to wrap the request.
I simplify the code to test what's the problem and this is my wrapper class
and
the relevant servlet code.
// Wrapper class
public class CompressionServletRequestWrapper extends
HttpServletRequestWrapper
public CompressionServletRequestWrapper(HttpServletRequest request)
throws
IOException{
super(request);
// Filter servlet
CompressionServletRequestWrapper wrappedRequest =null;
boolean entradaComprimida=false;
wrappedRequest=new CompressionServletRequestWrapper( httpRequest);
chain.doFilter(wrappedRequest, response);
Best Regards
Miguel Angel
-
I have a problem regarding OIM11g R1 "request for others", does anyone know how to add more field filter in the step where we select the user to be provisioned?
ThanksHi Robinson,
steps are correct, anyway this a helpful link http://azlav.umtblog.com/2011/03/16/capturing-the-project-narrative-with-project-server-2010/
Hope this help u.
Jalal Blali MCTS, MCITP -
Problem in sending HTTP request to the server.
Hi,
i dveloped an ant script for sar deployment.
i deployed a sar to my local soa server with ant script. it got deployed succesfully..
but when i try to deploy to a remote server, getting the below error..
"Problem in sending HTTP request to the server. Please make sure the server is up and/or check standard HTTP response code for 404"
but the server is up and runnig and i am able to ping it from my machine and also access the console...
below is my script
build.properties
wn.bea.home=C:/Oracle/Middleware
all.needed.jars.path=D:/SourceCode/neededJAR
oracle.soa.home=C:/Oracle/Middleware/Oracle_SOA1
java.passed.home=C:/Oracle/Middleware/jdk160_24
#Deployment environment
deployment.plan.environment=DEV
#Deploy Action
deployAction =redeploy
#credentials
user=weblogic
password=welcome1
#For Composite deployment
serverURL=http://10.177.154.6:7001
forceDefault=true
server=10.177.154.6
port=7001
sarLocation=D:/SourceCode/JAR
build.xml
<?xml version="1.0" encoding="iso-8859-1"?>
<project name="soaDeployAll" default="deployAll">
<echo>basedir ${basedir}</echo>
<property environment="env"/>
<echo>current folder ${basedir}</echo>
<property file="${basedir}/build.properties"/>
<taskdef resource="net/sf/antcontrib/antlib.xml">
<classpath>
<pathelement location="${all.needed.jars.path}/ant-contrib.jar"/>
</classpath>
</taskdef>
<target name="init">
<tstamp>
<format property="timestamp" pattern="yyyy-MM-dd_HH-mm-ss"/>
</tstamp>
<property name="build.log.dir" location="${basedir}/buildlogs"/>
<mkdir dir="${build.log.dir}"/> <property name="build.log.filename" value="build_${timestamp}.log"/>
<record name="${build.log.dir}/${build.log.filename}" loglevel="verbose" append="false"/>
<echo message="Build logged to ${build.log.filename}"/>
</target>
<target name="deployAll" depends="init">
<echo>Deploy for environment ${deployment.plan.environment}</echo>
<antcall target="deployAllComposites"/>
</target>
<!-- Following Actions are performed for Composite files in Managed Server - Deploy,Redeploy -->
<target name="deployAllComposites" depends="init">
<foreach target="deployComposites" param="Files">
<fileset dir="${sarLocation}" casesensitive="no" includes="*.jar"/>
</foreach>
</target>
<target name="deployComposites" depends="init">
<basename file="${Files}" property="basename"/>
<echo>Deploy Project ${basename} for environment ${deployment.plan.environment}</echo>
<if>
<equals arg1="${deployAction}" arg2="deploy" />
<then>
<echo message="Deploying composites in Managed server........." />
<ant antfile="${oracle.soa.home}/bin/ant-sca-deploy.xml" inheritAll="true" target="deploy">
<property name="serverURL" value="${serverURL}"/>
<property name="user" value="${user}"/>
<property name="password" value="${password}"/>
<property name="overwrite" value="false"/>
<property name="forceDefault" value="${forceDefault}"/>
<property name="sarLocation" value="${sarLocation}/${basename}"/>
</ant>
</then>
<else>
<echo message="ReDeploying composites in Managed server........." />
<ant antfile="${oracle.soa.home}/bin/ant-sca-deploy.xml" inheritAll="true" target="deploy">
<property name="serverURL" value="${serverURL}"/>
<property name="user" value="${user}"/>
<property name="password" value="${password}"/>
<property name="overwrite" value="true"/>
<property name="forceDefault" value="${forceDefault}"/>
<property name="sarLocation" value="${sarLocation}/${basename}"/>
</ant>
</else>
</if>
</target>
</project>
please help....Hi,
Give the serverURL as http://<host>:<managed.server.port>/soa-infra/deployer and try.
e.g . http://10.177.154.6:8001/soa-infra/deployer
Regards,
Neeraj Sehgal -
Problem in converting Spool Request into PDF format
Hi,
I am facing problem to convert spool request (which store output of sap script) in to PDF format. Actually I have converted it with function module 'CONVERT_OTFSPOOLJOB_2_PDF' and it is working properly but the problem occurs where the BOLD fonts are used. I am unable to see the Text/Address where i have used Bold Font in script (PDF FORMAT). Even though in (SPO1) spool request shows every thing perfectly (along with Bold Font). It will great if you could suggest me something.
Thanks,
PradeepHi Pradeep,
Use ,
Closing the Sapscript, we save data (OTF) in a table
CALL FUNCTION 'CLOSE_FORM'
TABLES
otfdata = t_otfdata
EXCEPTIONS
unopened = 1
bad_pageformat_for_print = 2
send_error = 3
spool_error = 4
OTHERS = 5.
DATA: BEGIN OF t_otfdata2 OCCURS 0.
INCLUDE STRUCTURE solisti1.
DATA: END OF t_otfdata2.
Move OTF data to another table with lenght 255
LOOP AT t_otfdata.
CONCATENATE t_otfdata-tdprintcom t_otfdata-tdprintpar INTO t_otfdata2.
APPEND t_otfdata2.
ENDLOOP.
Convert OTF format to PDF
CALL FUNCTION 'SX_OBJECT_CONVERT_OTF_PDF'
EXPORTING
format_src = 'OTF'
format_dst = 'PDF'
devtype = 'PRINTER'
FUNCPARA =
len_in = len_in
IMPORTING
len_out = len_out
TABLES
content_in = t_otfdata2
content_out = t_pdfdata
EXCEPTIONS
err_conv_failed = 1
OTHERS = 2.
Have a look at Progs. RSTXPDF4 and RSTXPDFT2 for converting the Spool to PDF.
Regards,
Raj
Message was edited by: Rajasekhar Dinavahi
Message was edited by: Rajasekhar Dinavahi -
Problem in Approving Requisition Request in MSS UWL
Hi,
I'm facing problem in approving requisition request sent through Manager in MSS UWL.
We have configured standard process HR_MSSRCF_REQUISITION with ISR scenario is SRQ3. Workflow is WS45600028
Case: When I successfully Check & Send Requisition Request form from MSS Recruitment, it is coming in Manager UWL.
But, when i open the workitem for approval it is not coming as a PDF form with Approve Button in the bottom (Standard). Instead, it opening as per the below screen.
Please help to resolve this issue.
RegardsYou should be giving the process reference number or workitem ID in transaction hrasr_test_process.
Which release you are on , what is the SP level of component EA-HRGXX?
Further as per note 972322 - HR Administrator: Migration WD4A - the start process application has been migrated to WDA.
Check the UWL XML configuration to see if the config is as below for the approval task...
APPLICATION ASR_PROCESS_EXECUTE(For EhP4, otherwise application depends on the level of EA-HRGXX )
DYNPARAM WI_ID=${item.externalId}
NAMESPACE sap
SYSTEM_ALIAS <use your system alias>
A sample XML is available with note - 1371626 - UWL Configuration for HR Administrator BP version 1.51.
This appears to me to be a XML configuration issue. Collaborate with your portal and UWL config consultant.
Hope this helps.
Regards,
Sahir. -
Problem with Non JSF Request to JSF Page
Hi All,
I am working on dynamic controls generation based on the request come from non jsf page
For the first request, pageworks perfectly. but when we go for second request, it is not rendering and I am getting same old page.
What I have identified is if I have 2 pages as JSF, application is not giving any problem.
For this I have written small test application contains both JSF pages only.
page1 contains 3 submit buttons.
When submit buttons are clicked based on the request, I get, am able to see the dynamic controls.
SO there is no problem with JSF PAGE to JSF Page Communication
Now I have done some changes in First JSF page. Instead of submitting directly I am submitting the page through JavaScript which is nonb JSF request. There I am facing the problem and based on requested qaction I am not able to see correct rendered page based on the requested action.
Any Idea why it is giving problem for non JSF requests??
Thanks
SudhakarFor Your Convenience in understanding the problem
I am pasting entire test code
Page 1 -- (here page2 is Page1 and Page1 is page2 - some naming convention errors :) )
<?xml version="1.0" encoding="UTF-8"?>
<jsp:root version="1.2" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:jsp="http://java.sun.com/JSP/Page">
<jsp:directive.page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"/>
<jsp:text><![CDATA[
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
]]></jsp:text>
<f:view>
<html lang="en-US" xml:lang="en-US">
<head>
<meta content="no-cache" http-equiv="Cache-Control"/>
<meta content="no-cache" http-equiv="Pragma"/>
<title>Page2 Title</title>
<link href="resources/stylesheet.css" rel="stylesheet" type="text/css"/>
</head>
<body style="-rave-layout: grid">
<h:form binding="#{Page2.form1}" id="form1">
<!-- Non JSF REquests -->
<h:commandButton action="#{Page2.button1_action}" binding="#{Page2.button1}" id="button1" style="left: 48px; top: 48px; position: absolute" value="Submit" onclick="document.forms['form1'].action='faces/Page2.jsp?id=1'; document.forms['form1'].submit(); return false;"/>
<h:commandButton action="#{Page2.button2_action}" binding="#{Page2.button2}" id="button2" style="left: 48px; top: 96px; position: absolute" value="Submit" onclick="document.forms['form1'].action='faces/Page2.jsp?id=2'; document.forms['form1'].submit(); return false;"/>
<h:commandButton action="#{Page2.button3_action}" binding="#{Page2.button3}" id="button3" style="left: 48px; top: 144px; position: absolute" value="Submit" onclick="document.forms['form1'].action='faces/Page2.jsp?id=3'; document.forms['form1'].submit(); return false;"/>
<!-- this is JSF request -->
<!--
<h:commandButton action="#{Page2.button1_action}" binding="#{Page2.button1}" id="button1" style="left: 48px; top: 48px; position: absolute" value="Submit" />
<h:commandButton action="#{Page2.button2_action}" binding="#{Page2.button2}" id="button2" style="left: 48px; top: 96px; position: absolute" value="Submit" />
<h:commandButton action="#{Page2.button3_action}" binding="#{Page2.button3}" id="button3" style="left: 48px; top: 144px; position: absolute" value="Submit" />-->
</h:form>
</body>
</html>
</f:view>
</jsp:root>Page1 Bean
* Page2.java
* Created on June 25, 2005, 11:08 AM
* Copyright user
package webapplication8;
import javax.faces.*;
import com.sun.jsfcl.app.*;
import javax.faces.component.html.*;
import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
public class Page2 extends AbstractPageBean {
// <editor-fold defaultstate="collapsed" desc="Creator-managed Component Definition">
private int __placeholder;
private HtmlForm form1 = new HtmlForm();
public HtmlForm getForm1() {
return form1;
public void setForm1(HtmlForm hf) {
this.form1 = hf;
private HtmlCommandButton button1 = new HtmlCommandButton();
public HtmlCommandButton getButton1() {
return button1;
public void setButton1(HtmlCommandButton hcb) {
this.button1 = hcb;
private HtmlCommandButton button2 = new HtmlCommandButton();
public HtmlCommandButton getButton2() {
return button2;
public void setButton2(HtmlCommandButton hcb) {
this.button2 = hcb;
private HtmlCommandButton button3 = new HtmlCommandButton();
public HtmlCommandButton getButton3() {
return button3;
public void setButton3(HtmlCommandButton hcb) {
this.button3 = hcb;
// </editor-fold>
public Page2() {
// <editor-fold defaultstate="collapsed" desc="Creator-managed Component Initialization">
try {
} catch (Exception e) {
log("Page2 Initialization Failure", e);
throw e instanceof javax.faces.FacesException ? (FacesException) e: new FacesException(e);
// </editor-fold>
// Additional user provided initialization code
protected webapplication8.ApplicationBean1 getApplicationBean1() {
return (webapplication8.ApplicationBean1)getBean("ApplicationBean1");
protected webapplication8.SessionBean1 getSessionBean1() {
return (webapplication8.SessionBean1)getBean("SessionBean1");
* Bean cleanup.
protected void afterRenderResponse() {
public String button1_action() throws Exception{
// TODO Following code was replaced by static navigation
getSessionBean1().setId(1);
/* ExternalContext ctx=(ExternalContext)FacesContext.getCurrentInstance().getExternalContext();
HttpServletRequest req=(HttpServletRequest)ctx.getRequest();
HttpServletResponse res=(HttpServletResponse)ctx.getResponse();
res.sendRedirect("http://localhost:18080/webapplication8/faces/Page2.jsp");
return null;*/
return "case1";
public String button2_action() throws Exception{
// TODO Following code was replaced by static navigation
getSessionBean1().setId(2);
/* ExternalContext ctx=(ExternalContext)FacesContext.getCurrentInstance().getExternalContext();
HttpServletRequest req=(HttpServletRequest)ctx.getRequest();
HttpServletResponse res=(HttpServletResponse)ctx.getResponse();
res.sendRedirect("http://localhost:18080/webapplication8/faces/Page2.jsp");
return null;*/
return "case2";
public String button3_action() throws Exception{
// TODO Following code was replaced by static navigation
getSessionBean1().setId(3);
/* ExternalContext ctx=(ExternalContext)FacesContext.getCurrentInstance().getExternalContext();
HttpServletRequest req=(HttpServletRequest)ctx.getRequest();
HttpServletResponse res=(HttpServletResponse)ctx.getResponse();
res.sendRedirect("http://localhost:18080/webapplication8/faces/Page2.jsp");
return null;*/
return "case3";
}page 2
<?xml version="1.0" encoding="UTF-8"?>
<jsp:root version="1.2" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:jsp="http://java.sun.com/JSP/Page">
<jsp:directive.page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"/>
<jsp:text><![CDATA[
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
]]></jsp:text>
<f:view>
<html lang="en-US" xml:lang="en-US">
<head>
<meta content="no-cache" http-equiv="Cache-Control"/>
<meta content="no-cache" http-equiv="Pragma"/>
<title>Page1 Title</title>
<link href="resources/stylesheet.css" rel="stylesheet" type="text/css"/>
</head>
<body style="-rave-layout: grid">
<h:form binding="#{Page1.form1}" id="form1">
<h:panelGrid binding="#{Page1.gridPanel1}" id="gridPanel1" style="left: 96px; top: 48px; position: absolute"/>
<f:selectItems binding="#{Page1.radioButtonList1SelectItems1}" id="radioButtonList1SelectItems1"/>
<h:commandButton action="#{Page1.button1_action}" binding="#{Page1.button1}" id="button1"
style="left: 384px; top: 120px; position: absolute" value="Submit"/>
<h:commandButton action="#{Page1.button1_action}" binding="#{Page1.button1}" id="button1" style="left: 384px; top: 72px; position: absolute" value="Submit"/>
<h:outputLink binding="#{Page1.hyperlink1}" id="hyperlink1" style="left: 480px; top: 216px; position: absolute" value="http://www.sun.com/jscreator">
<h:outputText binding="#{Page1.hyperlink1Text}" id="hyperlink1Text" value="Hyperlink"/>
</h:outputLink>
<h:commandLink binding="#{Page1.linkAction1}" id="linkAction1" style="left: 456px; top: 264px; position: absolute">
<h:outputText binding="#{Page1.linkAction1Text}" id="linkAction1Text" value="Link Action"/>
</h:commandLink>
</h:form>
</body>
</html>
</f:view>
</jsp:root>page2 bean
* Page1.java
* Created on June 25, 2005, 10:52 AM
* Copyright user
package webapplication8;
import javax.faces.*;
import com.sun.jsfcl.app.*;
import com.sun.jsfcl.data.DefaultSelectItemsArray;
import java.util.Vector;
import javax.faces.component.UIComponent;
import javax.faces.component.UISelectItems;
import javax.faces.component.html.*;
import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
import javax.faces.el.ValueBinding;
import javax.faces.model.SelectItem;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class Page1 extends AbstractPageBean {
// <editor-fold defaultstate="collapsed" desc="Creator-managed Component Definition">
private int __placeholder;
private HtmlForm form1 = new HtmlForm();
public HtmlForm getForm1() {
return form1;
public void setForm1(HtmlForm hf) {
this.form1 = hf;
private HtmlPanelGrid gridPanel1 = new HtmlPanelGrid();
public HtmlPanelGrid getGridPanel1() {
return gridPanel1;
public void setGridPanel1(HtmlPanelGrid hpg) {
this.gridPanel1 = hpg;
private HtmlCommandButton button1 = new HtmlCommandButton();
public HtmlCommandButton getButton1() {
return button1;
public void setButton1(HtmlCommandButton hcb) {
this.button1 = hcb;
private HtmlOutputLink hyperlink1 = new HtmlOutputLink();
public HtmlOutputLink getHyperlink1() {
return hyperlink1;
public void setHyperlink1(HtmlOutputLink hol) {
this.hyperlink1 = hol;
private HtmlOutputText hyperlink1Text = new HtmlOutputText();
public HtmlOutputText getHyperlink1Text() {
return hyperlink1Text;
public void setHyperlink1Text(HtmlOutputText hot) {
this.hyperlink1Text = hot;
private HtmlCommandLink linkAction1 = new HtmlCommandLink();
public HtmlCommandLink getLinkAction1() {
return linkAction1;
public void setLinkAction1(HtmlCommandLink hcl) {
this.linkAction1 = hcl;
private HtmlOutputText linkAction1Text = new HtmlOutputText();
public HtmlOutputText getLinkAction1Text() {
return linkAction1Text;
public void setLinkAction1Text(HtmlOutputText hot) {
this.linkAction1Text = hot;
// </editor-fold>
public Page1() {
// <editor-fold defaultstate="collapsed" desc="Creator-managed Component Initialization">
try {
ExternalContext ctx=(ExternalContext)FacesContext.getCurrentInstance().getExternalContext();
HttpServletRequest req=(HttpServletRequest)ctx.getRequest();
HttpServletResponse res=(HttpServletResponse)ctx.getResponse();
String id=req.getParameter("id");
if(id!=null)
getSessionBean1().setId(Integer.parseInt(id));
if (getSessionBean1().getId()==1) {
addTextBox();
else if (getSessionBean1().getId()==2) {
addCheckBox();
addRadio();
else if (getSessionBean1().getId()==3) {
addRadio();
// addCheckBox();
} catch (Exception e) {
log("Page1 Initialization Failure", e);
throw e instanceof javax.faces.FacesException ? (FacesException) e: new FacesException(e);
// </editor-fold>
// Additional user provided initialization code
protected webapplication8.ApplicationBean1 getApplicationBean1() {
return (webapplication8.ApplicationBean1)getBean("ApplicationBean1");
protected webapplication8.SessionBean1 getSessionBean1() {
return (webapplication8.SessionBean1)getBean("SessionBean1");
* Bean cleanup.
protected void afterRenderResponse() {
private void addRadio() {
HtmlPanelGrid gridPanel = new HtmlPanelGrid();
UIComponent parent = gridPanel1;
HtmlOutputText outputText = new HtmlOutputText();
outputText.setValue("Some Desc");
outputText.setId("somedesc2");
HtmlSelectOneRadio checkBox = new HtmlSelectOneRadio();
checkBox.setBorder(0);
checkBox.setLayout("pageDirection");
checkBox.setId("a3");
UISelectItems items = new UISelectItems();
DefaultSelectItemsArray objArray =new DefaultSelectItemsArray();
vectDefaultSelectItemsArray.add(objArray);
arrays=(DefaultSelectItemsArray[])vectDefaultSelectItemsArray.toArray(new DefaultSelectItemsArray[vectDefaultSelectItemsArray.size()]);
int size =arrays.length;
arrays[size - 1].clear();
for (int i =0;i<10;i++) {
arrays[size - 1].add(new SelectItem(""+i+"",""+i));
// array.setItems(new String[] {"Yes","No" });
items.setValueBinding("value",getValueBinding("#{Page1.arrays["+(size-1)+"]}"));
checkBox.getChildren().add(items);
gridPanel.getChildren().add(outputText);
gridPanel.getChildren().add(checkBox);
parent.getChildren().add(gridPanel);
private void addCheckBox() {
HtmlPanelGrid gridPanel = new HtmlPanelGrid();
UIComponent parent = gridPanel1;
HtmlOutputText outputText = new HtmlOutputText();
outputText.setValue("Some Desc");
outputText.setId("somedesc1");
HtmlSelectManyCheckbox checkBox = new HtmlSelectManyCheckbox();
checkBox.setBorder(0);
checkBox.setLayout("pageDirection");
checkBox.setId("a2");
UISelectItems items = new UISelectItems();
DefaultSelectItemsArray objArray =new DefaultSelectItemsArray();
vectDefaultSelectItemsArray.add(objArray);
arrays=(DefaultSelectItemsArray[])vectDefaultSelectItemsArray.toArray(new DefaultSelectItemsArray[vectDefaultSelectItemsArray.size()]);
int size =arrays.length;
arrays[size - 1].clear();
for (int i =0;i<10;i++) {
arrays[size - 1].add(new SelectItem(""+i+"",""+i));
// array.setItems(new String[] {"Yes","No" });
items.setValueBinding("value",getValueBinding("#{Page1.arrays["+(size-1)+"]}"));
checkBox.getChildren().add(items);
gridPanel.getChildren().add(outputText);
gridPanel.getChildren().add(checkBox);
parent.getChildren().add(gridPanel);
private void addTextBox() {
HtmlPanelGrid gridPanel = new HtmlPanelGrid();
UIComponent parent = gridPanel1;
HtmlOutputText outputText = new HtmlOutputText();
outputText.setValue("Some Description for Control Text Box");
outputText.setId("somedesc");
HtmlInputText textField = new HtmlInputText();
// textField.setId("textField_"+control.getId());
textField.setId("a1");
HtmlOutputText outputText1 = new HtmlOutputText();
hyperlink1Text.setValue(" ");
hyperlink1Text.setStyleClass("bodyText");
textField.setStyleClass("frmObjects");
gridPanel.setColumns(3);
gridPanel.getChildren().add(outputText);
gridPanel.getChildren().add(hyperlink1Text);
gridPanel.getChildren().add(textField);
parent.getChildren().add(gridPanel);
private DefaultSelectItemsArray array = new DefaultSelectItemsArray();
public DefaultSelectItemsArray getArray() {
return array;
public void setArray(DefaultSelectItemsArray dsia) {
this.array = dsia;
private Vector vectDefaultSelectItemsArray = new Vector();
private DefaultSelectItemsArray[] arrays = new DefaultSelectItemsArray[10];
public DefaultSelectItemsArray[] getArrays() {
return arrays;
public void setArrays(DefaultSelectItemsArray[]dsia) {
this.arrays = dsia;
private UISelectItems radioButtonList1SelectItems1 = new UISelectItems();
public UISelectItems getRadioButtonList1SelectItems1() {
return radioButtonList1SelectItems1;
public void setRadioButtonList1SelectItems1(UISelectItems uisi) {
this.radioButtonList1SelectItems1 = uisi;
private ValueBinding getValueBinding(String expression) {
return FacesContext.getCurrentInstance().getApplication().createValueBinding(expression);
public String button1_action() {
// TODO Replace with your code
return "case1";
}my navigation.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
"http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
<faces-config>
<navigation-rule>
<from-view-id>/Page2.jsp</from-view-id>
<navigation-case>
<from-outcome>case1</from-outcome>
<to-view-id>/Page1.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>case2</from-outcome>
<to-view-id>/Page1.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>case3</from-outcome>
<to-view-id>/Page1.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<from-view-id>/Page1.jsp</from-view-id>
<navigation-case>
<from-outcome>case1</from-outcome>
<to-view-id>/Page2.jsp</to-view-id>
</navigation-case>
</navigation-rule>
</faces-config>my managed beans xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
"http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
<faces-config>
<managed-bean>
<managed-bean-name>Page1</managed-bean-name>
<managed-bean-class>webapplication8.Page1</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>SessionBean1</managed-bean-name>
<managed-bean-class>webapplication8.SessionBean1</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>ApplicationBean1</managed-bean-name>
<managed-bean-class>webapplication8.ApplicationBean1</managed-bean-class>
<managed-bean-scope>application</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>Page2</managed-bean-name>
<managed-bean-class>webapplication8.Page2</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
<managed-bean>
</faces-config> -
I have Problem with Extract Filter which was working OK until recently.
Now, when I choose the filter the screen does not come up as the extract screen as it should and no other action can be taken except to press escape which returns me to normal. working. Looks as if the extraction function has been sleected but does not show?
I am trying to use the extract on a layer. Have tried to use it on a selection also.
Anyone suggest a solution please?
BillWithout a way to reset the tool, the only possibility seems to be to reset your preferences as described in the FAQ.
http://forums.adobe.com/thread/375776?tstart=0
You either have to physically delete (or rename) the preference files or, if using the Alt, Ctrl, and Shift method, be sure that you get a confirmation dialog.
This resets all settings in Photoshop to factory defaults.
(A complete uninstall/re-install will not affect the preferences and a corrupt file there may be causing the problem.) -
Problem while sending/Receiving request using the HttpURLConnection obj
Hi,
We are facing the problem while passing the request in Weblogic.
Looks like there is some problem with Weblogic while sending/Receiving the request using the HttpURLConnection object.
Currently we are migrating 2 applications to WebLogic. Application1 to application2 request should pass.
Below is some example we tried:
"When we send a request to our code using the SSOAdaptor code (which handles the request/session in our application) which is on the SunOne server the request parameters are received by our code successfully. And also in Create User Functionality of application1 we are sending a request to webpass(which is on Sunone Server) using the HttpURLConnection object and the SOAP request is received successfully by the Webpass."
Looks like when we send request (using HttpURLConnection) from a server other than Weblogic to a servlet in a Weblogic the request parameters are received with out issues.
Where as when the request is sent from WebLogic to WebLogic the request parameters are missing some how.
Is there any issue in Weblogic? Please helpus on this.
Thanks,
Nagesh
Edited by: user9307541 on Mar 15, 2010 5:08 AMHi,
Please find below scenario for testing.
We have tested the SSOAdaptor code (it is the fucntion name which will send the data from source) locally by hittiing the WPS adaptor URL in a Java client program(TestRequest.java) and the request parameters were reaching the WPS Adapter successfully.
Then we have written two test servlets to test the communication between SSOAdaptor(TestServlet.java) and WPS adaptor(WPSServlet.java).
Functionality of TestSevlet: It is sending a request to WPSServelt similar to the way we are doing it in SSOAdaptor.
Functionality of WPSServlet: It will receive the request parameters and write the parameter Map to console.
We have deployed and these two servlets(in a single webapplication) on Tomcat server and the request parameters are reaching the WPSServlet successfully.
Output on Tomcat server:
before sending request
**********************Inside WPS Servlet -- the request Map is:{TypeAcc=[Ljava.lang.String;@14e3f41, ServiceName=[Ljava.lang.String;@1acd47, GMEPortalUserID=[Ljava.lang.String;@19b04e2, UserID=[Ljava.lang.String;@5dcec6, Country=[Ljava.lang.String;@b25b9d}
after sending request
After this we have deployed these two servlets (with in a single webapplication) on the Weblogic server in Dev machine(path: /apps/usmport/domains/usmport/servers/usmport_admin/upload/ssoAdaptor/WEB-INF/classes/com/gm/gmeportal/security/adaptor) and
now the request parameters are not reaching the WPSServlet.
Output on Weblogic Server:
before sending request
**********************Inside WPS Servlet -- the request Map is:{}
after sending request
Looks like there is some problem with Weblogic while sending/Receiving the request using the HttpURLConnection object.
When we send a request to WPSAdaptor using the Old SSOAdaptor code which is on the SunOne server the request parameters are received by WPS successfully. And also in Create User Functionality of Portal we are sending a request to webpass(which is on Sunone Server) using the HttpURLConnection object and the SOAP request is received successfully by the Webpass.
Looks like when we send request (using HttpURLConnection) from a server other than Weblogic to a servlet in a Weblogic the request parameters are received with out issues. Where as when the request is sent from weblogic to weblogic the request parameters are missing some how.
Please find below javs source code used to test this:
TestRequest.java
import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
public class TestRequest {
* @param args
public static void main(String[] args) throws Exception{
// TODO Auto-generated method stub
excutePost("http://localhost:8080/Testing/TestServlet", "GMEPortalUserID=captest.wss@it0555&UserID=bl1133&Country=it&TypeAcc=256&ServiceName=Logon");
//System.out.println("********** Now the request is from SSO *****************");
//excuteGet("http://10.156.0.173:7013/channel21/wpsadapter", "GMEPortalUserID=captest.wss@it0554&UserID=bl1133&Country=it&TypeAcc=256&ServiceName=Logon");
public static String excutePost(String targetURL, String urlParameters)
URL url;
HttpURLConnection connection = null;
try {
//Create connection
url = new URL(targetURL);
connection = (HttpURLConnection)url.openConnection();
connection.setRequestMethod("POST");
connection.setRequestProperty("Content-Type",
"application/x-www-form-urlencoded");
connection.setRequestProperty("Content-Length", "" +
Integer.toString(urlParameters.getBytes().length));
connection.setRequestProperty("Content-Language", "en-US");
connection.setUseCaches (false);
connection.setDoInput(true);
connection.setDoOutput(true);
//Send request
DataOutputStream wr = new DataOutputStream (
connection.getOutputStream ());
wr.writeBytes (urlParameters);
wr.flush ();
wr.close ();
//Get Response
InputStream is = connection.getInputStream();
BufferedReader rd = new BufferedReader(new InputStreamReader(is));
String line;
StringBuffer response = new StringBuffer();
while((line = rd.readLine()) != null) {
response.append(line);
response.append('\r');
rd.close();
System.out.println("Response is:" + response);
return response.toString();
} catch (Exception e) {
e.printStackTrace();
return null;
} finally {
if(connection != null) {
connection.disconnect();
public static String excuteGet(String targetURL, String urlParameters) throws Exception
URL url = new URL(targetURL);
HttpURLConnection httpurlconnection =
(HttpURLConnection) url.openConnection();
/*httpurlconnection.setRequestProperty(
"cookie",
constructRequestParams(httpservletrequest.getCookies()));*/
httpurlconnection.setDoOutput(true);
httpurlconnection.setDoInput(true);
httpurlconnection.setRequestProperty(
"Content-length",
String.valueOf(urlParameters.length()));
OutputStream outputstream = httpurlconnection.getOutputStream();
outputstream.write(urlParameters.getBytes());
outputstream.flush();
//Get Response
try{
InputStream is = httpurlconnection.getInputStream();
BufferedReader rd = new BufferedReader(new InputStreamReader(is));
String line;
StringBuffer response = new StringBuffer();
while((line = rd.readLine()) != null) {
response.append(line);
response.append('\r');
rd.close();
System.out.println("Response from SSO is:" + response);
return response.toString();
} catch (Exception e) {
e.printStackTrace();
return null;
} finally {
if(httpurlconnection != null) {
httpurlconnection.disconnect();
TestServlet.java
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
* Servlet implementation class TestServlet
public class TestServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
* Default constructor.
public TestServlet() {
// TODO Auto-generated constructor stub
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
doPost(request,response);
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
//System.out.println("********************** the request Map is:" + request.getParameterMap());
try {
System.out.println("before sending request");
excuteGet("http://localhost:7003/ssoAdaptor/WPSServlet", "GMEPortalUserID=captest.wss@it0554&UserID=bl1133&Country=it&TypeAcc=256&ServiceName=Logon");
System.out.println("after sending request");
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
public String excuteGet(String targetURL, String urlParameters) throws Exception
URL url = new URL(targetURL);
HttpURLConnection httpurlconnection =
(HttpURLConnection) url.openConnection();
/*httpurlconnection.setRequestProperty(
"cookie",
constructRequestParams(httpservletrequest.getCookies()));*/
httpurlconnection.setDoOutput(true);
httpurlconnection.setDoInput(true);
httpurlconnection.setRequestProperty(
"Content-length",
String.valueOf(urlParameters.length()));
OutputStream outputstream = httpurlconnection.getOutputStream();
outputstream.write(urlParameters.getBytes());
outputstream.flush();
//Get Response
try{
InputStream is = httpurlconnection.getInputStream();
BufferedReader rd = new BufferedReader(new InputStreamReader(is));
String line;
StringBuffer response = new StringBuffer();
while((line = rd.readLine()) != null) {
response.append(line);
response.append('\r');
rd.close();
//System.out.println("Response from SSO is:" + response);
return response.toString();
} catch (Exception e) {
e.printStackTrace();
return null;
} finally {
if(httpurlconnection != null) {
httpurlconnection.disconnect();
WPSServlet.java
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
* Servlet implementation class WPSServlet
public class WPSServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
* @see HttpServlet#HttpServlet()
public WPSServlet() {
super();
// TODO Auto-generated constructor stub
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
System.out.println("**********************Inside WPS Servlet -- the request Map is:" + request.getParameterMap());
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
doGet(request,response);
Thanks,
Nagesh -
Problem with ALV filter functionality when filtered for multiple values
Hi,
I am facing a problem with ALV filter functionality.
I have displayed an ALV with some columns col_A, col_B and col_C
col_A---- col_B -
col_C
1----
a -
abc
2----
b -
pqr
3----
c -
lmn
4----
d -
xyz
5----
f -
stu
From the settings link I am applying filter on column col_C and selected multiple values say 'pqr', 'xyz' and 'lmn'.
Now the ALV is showing rows only for last selection i.e . results are fetched only for value 'lmn'.
i.e. after applying the filter the ALV table looks as below:
col_A---- col_B -
col_C
3----
c -
lmn
But ideally it should be:
col_A---- col_B -
col_C
2----
b -
pqr
3----
c -
lmn
4----
d -
xyz
I could not find any OSS note related to this issue.
Please help me resolve this issue.
Thanks,
FerozHi,
I am facing a problem with ALV filter functionality.
I have displayed an ALV with some columns col_A, col_B and col_C
col_A---- col_B -
col_C
1----
a -
abc
2----
b -
pqr
3----
c -
lmn
4----
d -
xyz
5----
f -
stu
From the settings link I am applying filter on column col_C and selected multiple values say 'pqr', 'xyz' and 'lmn'.
Now the ALV is showing rows only for last selection i.e . results are fetched only for value 'lmn'.
i.e. after applying the filter the ALV table looks as below:
col_A---- col_B -
col_C
3----
c -
lmn
But ideally it should be:
col_A---- col_B -
col_C
2----
b -
pqr
3----
c -
lmn
4----
d -
xyz
I could not find any OSS note related to this issue.
Please help me resolve this issue.
Thanks,
Feroz -
There was a problem inserting the Service Request: null
I am trying out service desk. When I try to create a request I get:
There was a problem inserting the Service Request: null
I can't see what the issues is. All fields marked in red are filled.
TomThomas,
It appears that in the past few days you have not received a response to your
posting. That concerns us, and has triggered this automated reply.
Has your problem been resolved? If not, you might try one of the following options:
- Visit http://support.novell.com and search the knowledgebase and/or check all
the other self support options and support programs available.
- You could also try posting your message again. Make sure it is posted in the
correct newsgroup. (http://forums.novell.com)
Be sure to read the forum FAQ about what to expect in the way of responses:
http://forums.novell.com/faq.php
If this is a reply to a duplicate posting, please ignore and accept our apologies
and rest assured we will issue a stern reprimand to our posting bot.
Good luck!
Your Novell Product Support Forums Team
http://forums.novell.com/ -
Hi all,
I have a problem when i filter ALV column, which has data type BELNR (FI doc No). I input in filter FI doc: 40000007 (8 char long, w/o zero ahead), then i get the empty result. The really one i want to get is a ALV line with FI doc = '40000007'.
Could u pls help me?
Thanks and regards,
Hung.Check the field catalog for field BELNR, it should have conversion exit ALPHA. (check your report or execute [The Consistency Check|http://help.sap.com/saphelp_sm32/helpdata/EN/d6/23253963143e6ae10000000a11402f/frameset.htm])
Regards,
Raymond -
Request wrapper is not of type HttpServletRequestWrapper
In Servlet when using the forward with RequestDispatcher, I get the foll error.
Exception: Request wrapper is not of type HttpServletRequestWrapper.
Below is the foll. code.
ServletContext sc = getServletContext();
RequestDispatcher rd = sc.getRequestDispatcher ("/initech/plugin/icard/example.jsp");
rd.forward(request, response); Help me on this.In Servlet when using the forward with RequestDispatcher, I get the foll error.
Exception: Request wrapper is not of type HttpServletRequestWrapper.
Below is the foll. code.
ServletContext sc = getServletContext();
RequestDispatcher rd = sc.getRequestDispatcher ("/initech/plugin/icard/example.jsp");
rd.forward(request, response); Help me on this. -
I just reinstalled Photoshop CS6. I'm running OS X 10.8.2 .
I use the Nik plugins suite, and reinstalled them as well. Now whenever I try to use one of those plugins I get the error "Could not complete the ... command because of a problem with the filter module interface."
The reinstallation was a bit of a struggle due to issues on Adobe's end, and I am hesitatnt to just dive in and reinstall without wome idea as to what might cause these errors.
Any insight appreciated.
StuNot sure I know what you mean by "disabling the Nik filter folder".
I have the latest updates for the Nik filters and they are compatible with CS6.
Since yesterday I tried uninstalling the Nik filters, manually locating and removing every file related to Nik/Nik Software, redownloading the Nik installers, uninstalling/reinstalling Photoshop, and reinstalling the Nik filters. Same result.
I am pretty sure this is something on the Photoshop end, but am not sure what to do next. Maybe repeat the above and use the Creative Suite cleaner before reinstalling?
Stu -
Problems about query filter (BEx).
Hello there,
I have some problems about query filter (BEx).
I have master data and I want to use attribute in this master data to dynamic filter in query(BEx).
But this attribute is key figure. I can't done it now. TT
Is this possible? If yes, could anyone advise how this is to be done?
Thanks in advance.Hi
In BEx there is option as 'Exceptions' & 'Conditions'. If you go in condition, you can specify range for key figure output. This is either predefined or by user selection. You create the condition as per your requirement & it will show you filtered data.
How to create conditions you will find easily on this site.
You can create as many conditions as no of filters you want. You can create these at query level also at report output level.
Maybe you are looking for
-
White Screen of Death - Hopefully not
I have been doing everything possible to repair my 16gig iPhone. It has an all white screen. I have tried to reset it, I tried updating to 3.0, I even restored to factory settings. It makes noise when I plug it into my laptop and iTunes recognizes it
-
Connecting my iMac to my Hughesnet modem?
Can someone please help me to connect my iMac to my Hughesnet modem? The tech who installed my Hughesnet said he could not get my computer to recognize my modem and Apple said that I had to pay to get help. If someone could please help, I would appre
-
IOS7 upgrade has ruined messaging, huge delay in typing before characters appear in screen on iPhone 4. Anyone else experiencing this?
-
Can't use Trash icon in Mail in iPhone after upgrade?
Hello all: Have two mail accounts on my iPhone, both IMAP. Before the switch to 5, one was POP. At that time I could delete an email from either account by simply hitting the trash icon at the bottom of the screen, while the email was open. Now, tapp
-
Copying part of filename in Finder
Hello Mavens, this is what I'd like to do: Enhance the Replace Text in Filename script that Apple provides with the OS in such a way that I can 1 - select a filename, as if for editing, in a folder 2 - select part of a filename (the part I want to ch