How to use forward slash in a string

ok, this is probably very simple, but i have a url that i need to pass into my app that looks like:
public void resize(URL url, String id)
}I'm trying to pass it a simple address of an image stored somewhere on the net but i am just faced with this instead:
class java.lang.NoSuchMethodError
resizeImage.resizeImage.resize(Ljava/lang/String;Ljava/lang/String;)V
Now i know that this is because there is something wrong with the arguments being passed into the method, which i'm doing like this:
imgManip.resize("http://www.screwfix.com/sfd/i/cat/59/p3248959_x.jpg","99"); what am i doing wrong?

Is a String a URL? Answer: No.
Create a URL from that string.

Similar Messages

  • How to use replace(CharacterSequence, CharacterSequence) in String class

    Need simple java program using the following
    how to use replace(CharacterSequence, CharacterSequence) in String class
    Kindly help

    From http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html#replace(java.lang.CharSequence,%20java.lang.CharSequence)
    replace
    public String replace(CharSequence target,
    CharSequence replacement)Replaces each substring of this string that matches the literal target sequence with the specified literal replacement sequence. The replacement proceeds from the beginning of the string to the end, for example, replacing "aa" with "b" in the string "aaa" will result in "ba" rather than "ab".
    Parameters:
    target - The sequence of char values to be replaced
    replacement - The replacement sequence of char values
    Returns:
    The resulting string
    Throws:
    NullPointerException - if target or replacement is null.
    Since:
    1.5

  • How to use execute immediate for character string value 300

    how to use execute immediate for character string value > 300 , the parameter for this would be passed.
    Case 1: When length = 300
    declare
    str1 varchar2(20) := 'select * from dual';
    str2 varchar2(20) := ' union ';
    result varchar2(300);
    begin
    result := str1 || str2 ||
    str1 || str2 ||
    str1 || str2 ||
    str1 || str2 ||
    str1 || str2 ||
    str1 || str2 ||
    str1 || str2 ||
    str1 || str2 ||
    str1 || str2 ||
    str1 || str2 ||
    str1 || ' ';
    dbms_output.put_line('length : '|| length(result));
    execute immediate result;
    end;
    /SQL> 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
    length : 300
    PL/SQL procedure successfully completed.
    Case 2: When length > 300 ( 301)
    SQL> set serveroutput on size 2000;
    declare
    str1 varchar2(20) := 'select * from dual';
    str2 varchar2(20) := ' union ';
    result varchar2(300);
    begin
    result := str1 || str2 ||
    str1 || str2 ||
    str1 || str2 ||
    str1 || str2 ||
    str1 || str2 ||
    str1 || str2 ||
    str1 || str2 ||
    str1 || str2 ||
    str1 || str2 ||
    str1 || str2 ||
    str1 || ' ';
    dbms_output.put_line('length : '|| length(result));
    execute immediate result;
    end;
    /SQL> 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
    declare
    ERROR at line 1:
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    ORA-06512: at line 6

    result varchar2(300);Answer shouldn't be here ? In the greater variable ?
    Nicolas.

  • How to use forward to

    Hello Experts,
    I want to use forward to filed in agent inbox for the below scenario.
    I want to place or replace organization in the organization tab page of the service ticket using forward to filed in agnet inbox.
    What I see in the customization is organization need to be identified as one of the partner functions in the partner determination procedure so that when organization is chosen in forward to will set organization partner function with the selected organization, but here I do not want to take organization as partner function and use u2018forward tou2019 to place or replace organization in organization tab page.
    Does any one know how to do this?
    It would be a great help from you if you can guide me.
    Awaiting to hear from you all.
    Thanks
    Srikanth

    Srikanth
    I think your scenario can also be explained as "Organization Redetermination".
    Out of the box the Forward to will replace the Responsible Org "Partner" and not the Org unit.
    So when the system sets the new Responsible Org "Partner" you have to replace the Org unit aswell.
    See the following thread it might help.
    organization redetermination
    Regards
    Rupesh

  • HT203167 the path for several of my songs that i can't locate is wrong because the path uses forward slashes instead of back slashes.  Can I change this?

    several of my songs in itunes gives me the can't locate ! sign.  in going to the info for each of those songs i noticed the path to locate the file was in proper format except for the slash marks which were / instead of \ .  how can i change the slash makrs in the paths for those songs?

    thanks for the info.  if itunes is applying the wrong path i.e. - forward slashes in path instead of backward slash how will i ever access those songs I've purchased.  it won't let me download them again because it thinks they are on my computer? 

  • How to use regular expression to find string

    hi,
    who know how to get all digits from the string "Alerts 4520 ( 227550 )  (  98 Available  )" by regular expression, thanks
    br, Andrew

    Liu,
    You can use RegEx as   
    d+
    Whether you are using CL_ABAP_REGEX class then
    report  zars.
    data: regex   type ref to cl_abap_regex,
          matcher type ref to cl_abap_matcher,
          match   type c length 1.
    create object regex exporting pattern = 'd+'
                                  ignore_case = ''.
    matcher = regex->create_matcher( text = 'Test123tes456' ).
    match = matcher->match( ).
    write match
    You can find more details regarding REGEX and POSIX examples here
    http://www.regular-expressions.info/tutorial.html

  • How to include /(Forward slash) in my regular expression

    Hai All,
    I am having a regular expression which should accept only A-Z,0-9, _(underscore) and .(period) .
    <property name="patterns" value="[A-Z0-9\\._]*" />
    Now i need to add /(Forward slash) to this expression.
    <property name="patterns" value="[A-Z0-9\\._/]*" />
    But when i add it it is accepting both Foward slash and Backward slash.
    Can someone guide me such that it accepts only A-Z, 0-9, Underscore, period and a Forward slash(/).
    Thx in advance..

    sabre150 wrote:
    Your regex without the / was accepting \ since '.' does not need to be escaped inside a character class. Just remove the \\ .And if you really did need to escape the dot, you would only have to use one backslash, not two: <property name="patterns" value="[A-Z0-9\._/]*" /> In Java source code you would have to use two backslashes because one of them gets consumed by the Java compiler. But this is obviously an XML file, so that rule doesn't apply. But, as Sabre pointed out, you don't need a backslash there at all: <property name="patterns" value="[A-Z0-9._/]*" />

  • How to use a var as a string

    hello, sorry for my question,
    but I want to use a var as a string:
    I know it is a completely beginners-question, but I didn´t need it until now:
    var zahl = Math.floor((Math.random()*99)+1);
    sym.$("frame")
              .css(
                                  {'background-image':'url("images/zahl.jpg")'
    I tried it with {zahl} and [zahl] but it does not work.
    Help would be great
    Oliver

    Thanks a lot,
    but sorry, I have no sucsess:
    var zahl = Math.floor((Math.random()*99)+1);
    sym.$("frame")
    .css(
                                                                {'background-image':'url("images/" + zahl + ".jpg")'
    here is the whole code again so that you can see if I made a fault.
    THX

  • How to use a WebService Model with String Arrays as its input  parameter

    Hi All,
    I am facing the following scenario -
    From WebDynpro Java i need to pass 2 String Arrays to a Webservice.
    The Webservice takes in 2 input String Arrays , say, Str_Arr1[] and Str_Arr2[] and returns a string output , say Str_Return.
    I am consuming this WebService in WebDynpro Java using WEB SERVICE MODEL. (NWDS 04).
    Can you please help out in how to consume a WSModel in WD where the WS requires String Arrays?

    Hi Hajra..
    chec this link...
    http://mail-archives.apache.org/mod_mbox/beehive-commits/200507.mbox/<[email protected]>
    http://www.theserverside.com/tt/articles/article.tss?l=MonsonHaefel-Column2
    Urs GS

  • How to use DB toolkit to input string 255 into ACCESS Database

    I am converting an existing LV-Application from LV5.1.1 w/SQL toolkit to LV7.1 with DB-Conn. Toolkit.  One of the tables in my MS-Access database has a field of TYPE=memo (allows string lengths > 255 characters).  I can't seem to find how to insert this field in the DB-table using the "DB Tools Insert Data.VI" without getting an error.  I have tried converting the input string to a [U8] array, but that also doesn't work.  Just inputing the long string (390-chrs) also gives an error.  Reducing the string length to < 255 allows the new record to be input into the table without errors.  However, I need to be able to input the longer strings for the application to work.
    Does anyone have a solution to this problem.
    Thanks,
    Jim Cardinal

    Something like this
    David
    Message Edited by David Crawford on 01-12-2006 11:53 AM
    Attachments:
    Insert Text to Memo Using DBT.jpg ‏14 KB

  • How to use sed on a literal string containing regex meta characters?

    I want to delete the lines from a file which match an arbitrary literal string.
    The string is contained in a variable, and may itself contain various regex meta characters such as [,],^,$,|, etc
    So, my problem is that sed wants to interpret these meta characters itself. For example:
    x='abc[xyz$'
    sed -i "/$x/d" file
    produces a sed error about the unmatched [, and no doubt it wants to interpret the $ too.
    (Of course, I could try and change the string $x so that every possible regex meta character was escaped with a \, but that seems immensely cumbersome. Also, can't see a way of using single or double quotes cleverly.)
    Sorry if I am being thick about this, but any ideas or alternative methods would be most welcome!

    frostschutz wrote:
    With sed, you have to escape meta characters indivudually. That's just how it works. Of course you could do the escaping using sed as well, by replacing all meta characters (including \ and /) with \character.
    If you want to match strings literally, use a different tool. Or do it in Bash.
    while read line
    do
    [ "$line" != "$x" ] && echo "$line"
    done < file
    In Perl/PCRE instead of escaping indivudually there is \Q...\E but sed does not understand that, and \Q\E does not solve all problems either, if there is a \E in the $x you have to escape it with \E\\E\Q or something like it.
    Thank you for your swift reply. Looks like sed can't be much of a friend in these circumstances!
    Probably will have to go with the Bash file handling method.
    Oh well ...

  • PowerShell-EWS How to use .Forward Method of EmailMessage Class

    Hello, 
    im new to PowerShell and EWS and would like to know how to forward an E-Mail with the .Forward Method of the EmailMessage Class.
    Is it possible to also forward an Email with an FileAttachment?
    I already have access to the Messages i want to forward but i cant figure out how to .Forward these Messages.
    Thank you for your help
    Greetings 
    Ingo

    >> Is it possible to also forward an Email with an FileAttachment?
    Yes doing a normal forward is EWS should maintain the attachment on the message eg the following would forward the last email in the Mailbox
    $folderid= new-object Microsoft.Exchange.WebServices.Data.FolderId([Microsoft.Exchange.WebServices.Data.WellKnownFolderName]::Inbox,$MailboxName)
    $Inbox = [Microsoft.Exchange.WebServices.Data.Folder]::Bind($service,$folderid)
    $ivItemView = New-Object Microsoft.Exchange.WebServices.Data.ItemView(1)
    $fiItems = $null
    $fiItems = $service.FindItems($Inbox.Id,$ivItemView)
    $messageBodyPrefix = "This is message that was forwarded by using the EWS Managed API";
    $addresses = New-Object Microsoft.Exchange.WebServices.Data.EmailAddress[] 1
    $addresses[0] = "[email protected]";
    $fiItems.Items[0].Forward($messageBodyPrefix, $addresses);
    If your looking to forward the actual message as an attachment you can use something like
    http://gsexdev.blogspot.com.au/2013/07/forwarding-message-as-attachment-using.html
    Cheers
    Glen

  • How to use ora:parseEscapedXML() Function with String Content

    Hello,
    I am receiving a ResponseMessage that returns a string, but the content of the string is actually XML. I have tried to use the ora:parseEscapedXML() function to parses the string (see XML Fragment below) to return structured XML data that can be assigned to typed BPEL variables. The documentation is very limited for this (I've looked in the Developer Guide draft that is available at the OraBPEL site).
    2 customer records from XML literal fragment copied from string result:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <recordset>
    <customer>
    <CustNum>AROUT</CustNum>
    <CustLName>Hardy</CustLName>
    <CustFname>Thomas</CustFname>
    <CustEmail>[email protected]</CustEmail>
    <CustAddress>120 Hanover Sq.</CustAddress>
    <CustCity>London</CustCity>
    <CustRegion></CustRegion>
    <CustPostalCode>WA1 1DP</CustPostalCode>
    <CustCountry>UK</CustCountry>
    </customer>
    <customer>
    <CustNum>BSBEV</CustNum>
    <CustLName>Ashworth</CustLName>
    <CustFname>Victoria</CustFname>
    <CustEmail>Victoria.Ashworth@B&apos;s.com</CustEmail>
    <CustAddress>Fauntleroy Circus</CustAddress>
    <CustCity>London</CustCity>
    <CustRegion></CustRegion>
    <CustPostalCode>EC2 5NT</CustPostalCode>
    <CustCountry>UK</CustCountry>
    </customer>
    The copy rule for assigning CustNum to accountnumber that fails:
    <copy>
    <from expression="ora:parseEscapedXML(bpws:getVariableData('DataService_OutputVariable','invokeSpecMsgReturn','/recordset/customer/CustNum'))"/>
    <to variable="outputVariable" part="payload" query="/client:QueryResult/client:customer/client:accountNumber"/>
    </copy>
    Any help would be greatly appreciated.
    Thanks,
    Sean

    Hello,
    I am attempting to provide more information in order to hopefully get some better guidance here.
    1) The BPEL process I built receives input from a client that is one of city name or region name or postal code or country name and returns a list of customer records with their AccountNumber, LastName, FirstName, Email, Address, City, Region, PostalCode and Country. The BPEL flow invokes a packaged integration Web Service that retuns the records in a string whose content is XML (see XML fragment below).
    2) The string content returned is vaiable based on the input (i.e. city name="London")
    Two customer records from XML literal fragment copied from string result:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <recordset>
    <customer>
    <CustNum>AROUT</CustNum>
    <CustLName>Hardy</CustLName>
    <CustFname>Thomas</CustFname>
    <CustEmail>[email protected]</CustEmail>
    <CustAddress>120 Hanover Sq.</CustAddress>
    <CustCity>London</CustCity>
    <CustRegion></CustRegion>
    <CustPostalCode>WA1 1DP</CustPostalCode>
    <CustCountry>UK</CustCountry>
    </customer>
    <customer>
    <CustNum>BSBEV</CustNum>
    <CustLName>Ashworth</CustLName>
    <CustFname>Victoria</CustFname>
    <CustEmail>Victoria.Ashworth@B&apos;s.com</CustEmail>
    <CustAddress>Fauntleroy Circus</CustAddress>
    <CustCity>London</CustCity>
    <CustRegion></CustRegion>
    <CustPostalCode>EC2 5NT</CustPostalCode>
    <CustCountry>UK</CustCountry>
    </customer>
    I want to <assign> each record from the packaged integration service result (the string whose content is XML) to a complexType variable defined within the BPEL Process WSDL (see example below).
    XML fragment from BPEL WSDL:
    <element name="QueryResult" type="client:recordType"/>>
    <complexType name="recordType">
    <sequence>
    <element name="customer" type="client:customerType" maxOccurs="unbounded"/>
    </sequence>
    </complexType>
    <complexType name="customerType">
    <sequence>
    <element name="accountNumber" type="string"/>
    <element name="lastName" type="string"/>      
    <element name="firstName" type="string"/>
    <element name="email" type="string"/>
    <element name="address" type="string"/>
    <element name="city" type="string"/>
    <element name="region" type="string"/>
    <element name="postalcode" type="string"/>
    <element name="country" type="string"/>
    </sequence>                         
    </complexType>
    I have read through the tutorial and reviwed the XPath Funtion example in the reference (C:\OraBPELPM_1\integration\bpelpm\orabpel\samples\references\XPathFunction), but I am stsill very unclear as to how to handle this. I would appreciate any and all help.
    Thanks,
    Sean

  • How to use Sockets to send/recieve Strings in XML form?

    Hello there to everyone reading my Post !
    I am entering a total new subject in my learning about Java Programming, where I will need to interact with a server, I was wondering If somebody could help me with a Question I have; here it is:
    A server provided me a Socket, (and that is of course an IP address and a Port), And I am supposed to connect to that server using a Java program that connects to servers using a Socket class, then I am supposed to send a String representing a valid XML, and then the server replies me With another String representing a valid XML which I am supposed to store in a String type.
    Is this exact write/read operation possible? If so, could someone please give me some code samples to solve this problem?
    PD: The server Does this operation only: recieve/send Strings. as its called transactional switch.

    Hi ejp, thank you very much for the quickest of replies.
    I am wondering If could you please give me a more detailed source code sample, and the reasons are:
    Well, first I am a newbie. and secondly, and most importantly, I actually can try to send the String that represents the XML, but then...
    I don't have any idea about how to know when my program has finished sending the String. and therefore I wouldn't know where to put the lines of code that start reading the corresponding response String.
    Could you please help me out?
    PD: I've been using DOM to read XMLs. Does DOM Objects also allow to read/write XMLs using Sockets?
    Thanks in advance!

  • How to use certain parts of a string-parsing???

    I have a form which pulls some data from a db. For example, it pulls the following about what office I work in:
    DS/ISC/GCS/ABC/DEFG
    The DS refers to the larger office, ISC referes to the next office down, and so forth. I CANNOT CHANGE THESE VALUES.
    What I'd like to do is 'disect' this long string based on where the "/" lie in the string.
    I'm basically only interested in the first two offices. In this example DS and ISC. So, when I want to display the parent office, the only string to display is DS and not DS/. Then on another line, I want to display the sub office ISC and not ISC/ . I guess I could parse? But I'm not sure exactly how to do this. If there is another 'easy' way to do this, I'd open to any suggestions.
    TIA

    http://forum.java.sun.com/thread.jspa?threadID=682574&tstart=0

Maybe you are looking for

  • Strange gaps in Header and Footer

    Im getting gaps in the header and footer on some of my pages.  Sometimes the gaps are filled with the background color of the colomn and other times they are the body color which is even weirder.  An example link would be http://www.mojogar.com/pcRep

  • ABAP/Java Stack download

    Hi all! Someday last year (2005) I visited the download area at sdn and found an item in the WebAs section. The download-item contained the abap- and the java-stack in one package for windows. I did however not download the item, which was a great mi

  • [REQUEST] vBIOS for MSI N660 TF 2GD5/OC

    nvflash doesn't like the backup of my original vBIOS for some reason. Can I get a copy of either the original or latest vBIOS for the following please? MSI N660 TF 2GD5/OC S/N is 602-V287-190B1312000547 Thanks!

  • Localhome doesnot appear on the jndi tree on weblogic 8.1 after deployment

    I am upgrading my application from weblogic6.1 to weblogic 8.1 sp3. I have a stateless session bean with local interfaces. when I deploy the bean to the weblogic 8.1 server, everything seems to be fine and no error occurs. but when I view the JNDI tr

  • Can I update to Safari 7 on my iMac 10.6.8?

    Am I able to download Safari 7 to use on my iMac 10.6.8?