StringBuffer Object  in Request

Hi,
How to pass StringBuffer Object From JSP to Struts Action.that's i have to get the String Buffer Object from Request .Instead of Using Session
Regards
john
+91 9791132453

Parameters to servlets/jsps can only be strings.
Is there any reason it can't be a String object as opposed to a StringBuffer?
The only way this would work is if you sent the String as a value on the JSP, and then re-submitted it to the server.
Thats a round trip for the value. If the value is not too large, you should be ok, but given you are using StringBuffer I kinda doubt thats the case :-).
Cheers,
evnafets

Similar Messages

  • Including StringBuffer object in my mail message

    I am getting text from the textarea of my jsp page
    <textarea name="reason" rows="5" cols="40"></textarea>
    StringBuffer comment = new StringBuffer(request.getParameter("reason"));
    int loc = (new String(comment)).indexOf('\n');
    while(loc > 0){
    comment.replace(loc, loc+1, "<BR>");
    loc = (new String(comment)).indexOf('\n');
    I have save this in a StringBuffer object, comment. Now I want the comment to be the text of my mail message
    msg.setText( comment );
    When I compile this, I get the message
    "SRSBean.java": Error #: 300 : method setText(java.lang.StringBuffer) not found in class javax.mail.Message at line 659, column 9
    How can I include the text in the comment object in my mail ?

    Yes that works. But when i check my email i see that the <BR> is inserted.
    i want this to be a new line in the mail. how can i do this?

  • How to set  an object in request scope in  a jsp uysing  jstl

    I usally use scriptlet in jsp to set an object in request is
    there a way to do this using jstl
    instead of this
    <%request.setAttribute("test",myObject);%> I want to use tag ?

    The <c:set> tag should be useful...
    Of course if you can access it as a JSTL variable it IS already an attribute in scope.

  • Passing large objects in request

    Is it bad practice to pass large objects such as an ArrayList with large amounts of data in the request object? Will it impact performance?

    dorr67 wrote:
    Yes, to be more specific, I'm creating a List from my DAO and putting in the HttpServletRequest object using request.setAttribute("dataList", dataList), then retrieving the List in the jsp to render a datagrid. I was concerned if this could be a problem down the road when dealing with large amounts of data in the list. Pagination will be handled in the grid component, but I was concerned with getting the data source to the grid. I'm using Spring so if there is a more efficient manner to do this, please let me know.
    Thanks.Sounds like it doesn't scale good if you have lots of users, but it's only a reference to the list that is passed around.
    Kaj

  • Including Objects in Request from Other System

    I've got an interesting question. This will be hard to explain but here goes: You know how you can u201CInclude Objects in Requestu201D? E.g. create a new request from an old one and copy the keys from the old one to the new one. That way when you release the new request it gets the current version of all the objects.
    Well I want to do that except in different systems. For example I have request SBXK900123 in system SBX with some objects in it. I want to create a request in DEV with the same object list. So then I can release the request from DEV to QAS & PRD. I don't want to transport from SBX and I want the versions of the objects in DEV, not SBX.
    I tried adding SBXK900123 to DEVu2019s import buffer without actually importing it. It gets added to the buffer but in SE09 Transport Organizer in DEV the system doesnu2019t see SBXK900123. So I canu2019t include the objects in SBXK900123 in a new request in DEV. If I actually import SBXK900123 into DEV then the Transport Organizer sees it but of course I donu2019t want to import from SBX to DEV.
    Any thoughts?

    Thanks Gentlemen, I appreciate your help.
    Hereu2019s some clarification. This is just a one-time thing, however copy and paste will be difficult because there might be hundreds of tables with thousands of entries. Since they are primarily config entries I would have to drill into each view/table to display all the keys. The ABAP approach might have promise but since I am not an ABAPu2019er, and getting ABAP help is difficult at my company, Iu2019m still looking.
    Roman, yes that is exactly what I am doing however the request isnu2019t available from the display button in SE09. Are you sure you didnu2019t also import the request? Thatu2019s the only way I can make it available; Iu2019ve tried Add to buffer and forwarding to system client. It is in the import queue but in SE09 I still get the message:
    Request/task SBXK900035 does not exist
    Message no. TR806
    Diagnosis
    Request/task SBXK900035 cannot be edited because it does not exist in this SAP  system.
    System Response
    The function is terminated.
    Procedure
    Repeat the function with an existing request or task.
    If you didnu2019t import the request, how did you add it to the buffer to make it available in SE09? Well, thank you all.
    David

  • Storing Objects in Request Scope

    Hello,
    I'm trying to pass an object in the request scope between a JSPDynPage and the associated JSP however the object is always null. If I store it in the session I am able to retrieve it.
    Could anyone assist in how to do this?
    My code is as follows, thanks and regards.
    public class MyClass extends PageProcessorComponent {
      private String redirectToPage = "";
      private static final String INITAL_PAGE = "initialpage.jsp";
      private static final String SECONDARY_PAGE = "secondarypage.jsp";
      private static final String BEAN_ALIAS = "myBean";
      public void doProcessBeforeOutput() throws PageException {
        if (redirectToPage == null || redirectToPage.equals("")) {
          this.setJspName(INITAL_PAGE);
        } else {
          this.setJspName(redirectToPage);
      public void onMyButtonEvent (Event event) {
        redirectToPage = SECONDARY_PAGE;
        MyBeanClass myBean = new MyBeanClass();
        IPortalComponentRequest componentRequest = (IPortalComponentRequest)getRequest();
        componentRequest.putValue(BEAN_ALIAS, myBean);
    secondarypage.jsp:
    <%@ page session = "true"%>
    <%@ taglib uri="tagLib" prefix="hbj" %>
    <jsp:useBean id="myBean" scope="request" class="MyBeanClass " />
    <hbj:content id="myContent">
      <hbj:page title="myTitle">
       <hbj:form id="myForm">
         <% if (myBean != null) {
              out.println("null");
            } else {
              out.println("not null");
         %>
       </hbj:form>
      </hbj:page>
    </hbj:content>
    output on the page is always "null" ??

    Hi,
    Thanks for your posts... the null logic was actually a typo.
    I've solved the problem myself - basically I think the <jsp:useBean doesn't work as I expect it (that is automatically obtain the handle to the bean):
    MyDynPage.java:
    package com.my;
    import com.sapportals.htmlb.*;
    import com.sapportals.htmlb.enum.*;
    import com.sapportals.htmlb.event.*;
    import com.sapportals.htmlb.page.*;
    import com.sapportals.portal.htmlb.page.*;
    import com.sapportals.portal.prt.component.*;
    public class MyDynPage extends PageProcessorComponent {
      public DynPage getPage(){
        return new MyDynPageDynPage();
      public static class MyDynPageDynPage extends JSPDynPage{
        public void doInitialization(){
        public void doProcessAfterInput() throws PageException {
        public void doProcessBeforeOutput() throws PageException {
              IPortalComponentRequest componentRequest = (IPortalComponentRequest)getRequest();
              componentRequest.putValue("myRequestParam", "My Request Param Value");
              MyBean myBean = new MyBean("My Bean Title Value");          
              componentRequest.putValue("myBean", myBean);
             this.setJspName("myJSP.jsp");
    MyBean.java:
    package com.my;
    import java.io.Serializable;
    public class MyBean implements Serializable {
         private String txtTitle;
         //setters
         public void setTxtTitle(String txtTitle) { this.txtTitle = txtTitle; }
         //getters
         public String getTxtTitle() { return this.txtTitle; }
         public MyBean(String txtTitle) { //constructor
              this.txtTitle = txtTitle;
    myJSP.jsp:
    <%@ page session = "true"%>
    <%@ taglib uri="tagLib" prefix="hbj" %>
    <jsp:useBean id="myBean" scope="request" class="com.my.MyBean" />
    <hbj:content id="myContext" >
      <hbj:page title="PageTitle">
       <hbj:form id="myFormId" >
        <%
               String myRequestParam = (String)componentRequest.getValue("myRequestParam");
              out.println("myRequestParam: " + myRequestParam + "<br>");
              if (myBean == null) {
                   out.println("myBean is null<br>");
              } else {
                   out.println("myBean is not null<br>");
                   out.println(myBean.getTxtTitle() + "<br>");
              com.my.MyBean myOtherBean = (com.my.MyBean) componentRequest.getValue("myBean");
              if (myOtherBean == null) {
                   out.println("myOtherBean is null");
              } else {
                   out.println("myOtherBean is not null<br>");
                   out.println(myOtherBean.getTxtTitle() + "<br>");
        %>
       </hbj:form>
      </hbj:page>
    </hbj:content>
    The output is:
    myRequestParam: My Request Param Value
    <b>myBean is null</b>
    myOtherBean is not null
    My Bean Title Value
    It appears that you can save objects in the request scope however you need to manually retrieve them. I'm pretty sure that this is not the case in other J2EE servers as the <jsp:useBean tag should imply that I want the bean retrieved from the scope automatically or created if it's null.
    However the use of the <jsp:useBean appears to work correctly/as expected when using the session scope.
    Thanks for your assistance.
    DSR

  • Set the value of a object in request scope

    I have the object in my req scope. I need to set value to one of the object attributes if that attribute is blank. How can I set its value.
    <c:set var="benefitVO" value="${requestScope.BenefitVO}" />I need to set the following Object attribute value, if it is blank.
    something like --- > benefitVO.setBnftCd("asdf");
    How can I set it using JSTL tags?
    any ideas
    Thanks

    I need to set value to one of the object attributes if that attribute is blank.This is some kind of a default value that you want, then? If so then just take care of that when you output it. Use <c:if>, and if the attribute is blank then output the default value, otherwise output the attribute.
    Or have the servlet that created that request attribute take care of that requirement.

  • Best practice ?  send Object to request or desired pieces of data?

    Newbie to this style of programming...
    Is the best practice to put the customer object in the session or request object and allow jsp's to declare and instantiate the customer object out of the session/request (then use whatever getters are needed to properly display the desired data)?
    Or would it be better to send the customer ID, Name, address etc as a string to the session/request object and just have the JSP declare the strings & instantiate from the session/request object(thus keeping more complicated java code out of the jsp)?
    Thanks for the help in advance!

    Doesn't this result in more code? If we send the object, we need code to declare and instantiate the object, then use the getters to get the data to display.
    If I just send the necessary data, I just need to declare a string = request.getParameter... or just display the request.getParameter.
    I actually like the concept of sending the object, it seems cleaner and less likely to result in servlet changes down the road, but i want to make sure there is not some other reason NOT to do this.

  • Download objects in request

    Hello,
    our development in the german system must be transfered to the british system (no RFC connection). I know there´s way to download all objects in the transport request into a file so that the colleagues in UK can upload this file.
    Can somebody please explain the steps to do this ??
    Thanks.

    simply create and release a transport with the desired objects, then just copy the cofile and datafile from the source system to the traget system and import.
    You'll find the cofile at /usr/sap/trans/cofile with format <sid>K<numbeer> and the datafile at /usr/sap/trans/data with format <sid>R<number>. Copy these file to the same directories at the target system and the just go to STMS -> Extras -> Add -> insert the transport number -> Import.
    Thats it.
    Regards
    Juan

  • Troubles with save object in request

    Hi All!
    I have trouble with saving EditCurrentRecord in request. In JDeveloper everything works fine. But when I try to run on iAS with Apache/Jserv I get jsp compilation error:
    java.lang.NoSuchMethodError: javax.servlet.ServletRequest: method setAttribute(Ljava/lang/String;Ljava/lang/Object;)V not found
    I have this problem with a lot of my pages.
    First time I thinks problem is in my code. By after removing every line of my custom code and leaving only JD code, I get the same error. Some pages works fine, another no! They are looks very simillary.
    I also take a look at servlet code. It's look great.
    Anybody have this problem?
    null

    Hi Dev,
    Please check the FG 'STRD', it should have FM for your requirement.
    Like FM 'TR_OBJECT_INSERT' or TR_OBJECTS_INSERT etc.
    Best Regards,
    Swanand

  • Changing object transport request

    Hi,
    I'm doing customizing creating a sales organization and defining output type.
    By accident I put these two in the same transport request.
    I want to move the defining output type object to another transport request as I want to transport that one first but I don't want to delete the creating sales organization.
    Any way to do it?
    I tried using object directory entry but can't.
    Thanks.
    Dwi

    Hi Dwi,
    No need to delete anything.
    If u imported it into any box we can't do anything.
    But there is one method to overwrite it by assigning it as different TR's
    So if u exported now, dont touch the TR(Transport Request)
    The different tasks what this TR contains assign it as different TR's and release them in which order you want.
    Try this and reward us if it helpful to u.
    Regards
    Adarsh

  • Locationg source system object  transport request number in target system .

    Hi,
    After the object is pushed from source system to target using SCC1 for cross clients but same systems or STMS for cross-systems, if we want to see the object's source system's transport request number in the target system, how can we see that ?
    Regards,
    Rajesh.

    Hi Rajesh
    If my understanding is correct you want to know the source server in the target system( i.e where we have transported).
    For cross-system objects, as you know we use STMS to transport them...
    In the target system:
    1. SE10
    2. Click on Transports button.
    3. Select the required request and expand the node.
    4. You will have the first one which has log only for Export.
    The node with only Export log is the source system...
    Hope this helps...
    Kind Regards
    Eswar

  • Deleting object fro request

    Dear All,
    Had created two program with the same request number .. now wants to delete the one out of it .. how this can be done withour effecting the other..
    Mail back soon.

    Do you just want to delete the program out of the transport? Then just go to SE10, press F5 key, enter your request number, press enter.
    Once you see the request, select the task (lower number) and then click the button for 'object list'. Here you will see two entries, one for each program. Switch to change mode and delete the entry, save and exit.
    Now one question that remains is how to transport this other program. You can create a transport for it again.
    Srinivas
    Please close your duplicate post regarding changing the development class.

  • Add object to request

    Gurus
    How to add objects to a request having some other objects .
    Thankyou gurus

    Hi,
    You can add the objects using SE10 also.
    Double click on the request, goto change and enter the object type and enter the object. Save.
    After that donot forget to lock the object before transport release.
    Hope this helps..
    Thank you,
    S R.

  • Reading XML object from Request object

    Hi,
    We are using Flash in our web application in which we are sending an XML object using HTTP post method to a JSP where we need to parse the XML object and get the values. Can anyone tell how we can do it?

    In fact we are not getting error in our page. following is the error
    Error: 500
    Location: /team/par/getData10.jsp
    Internal Servlet Error:
    java.lang.IllegalArgumentException
         at javax.servlet.http.HttpUtils.parseQueryString(HttpUtils.java:151)
         at javax.servlet.http.HttpUtils.parsePostData(HttpUtils.java:254)
         at org.apache.tomcat.util.RequestUtil.readFormData(RequestUtil.java:101)
         at org.apache.tomcat.core.RequestImpl.handleParameters(RequestImpl.java:719)
         at org.apache.tomcat.core.RequestImpl.getParameterValues(RequestImpl.java:259)
         at org.apache.tomcat.core.RequestImpl.getParameter(RequestImpl.java:250)
         at org.apache.tomcat.facade.HttpServletRequestFacade.getParameter(HttpServletRequestFacade.java:223)
         at org.apache.jasper.servlet.JspServlet.preCompile(JspServlet.java:437)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:480)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
         at org.apache.tomcat.core.Handler.service(Handler.java:287)
         at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
         at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:812)
         at org.apache.tomcat.core.ContextManager.service(ContextManager.java:758)
         at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:213)
         at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
         at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
         at java.lang.Thread

Maybe you are looking for

  • Where did all the setting for printing go in PSE8-Mac?!

    OK, I'm probably missing some obvious settings somewhere, please tell me after you read my rantings... I'm using the 'Full Edit' mode, assuming that is important. But the new Print Dialog looks like it has been dumbed down for some one, not sure who,

  • How to implement implicit and explicit enhancement points

    Hi, Can anybody please provide some technical aspects of enhancement spots. I have gone through several sap sites and help poratl but have not get much technical things (how to implement or related t codes). please do not provide link to read theorie

  • Zen Touch: Same unsolvable button prob

    The player has been nothing but joy since I bought it. Flawless functionality with only minor problems with the Mediasource software, but nothing with the player itself. Just recently though, all of the face buttons and the scroll wheel stopped worki

  • Problem with File panel and Local files

    I am having a couple of problem using Dreamweaver  (which may be related) and can't find any appropriate help on the web site. I have created a small website and have it up and running.    I'm now trying to do some minor modifications.     But Dreamw

  • RE: issue with sample watermark apperaring in purchase order

    Hi Team, our client is facing an issue when Purchase order is got created from production and when it is released an email notification is been send to vendor and today in the purchase order sample watermark is appearing in the background when i cros