Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!

Gershwin Yesudhas

Greenhorn
+ Follow
since May 09, 2010
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Gershwin Yesudhas

That's ok Fred.
Thanks anyway.

Let's see if someone has any idea about this.


Regards,
Gershwin
7 years ago
Hi,

Can you please help with how to split the Regex and assign it to specific string variables?
The regex which need to be split and assigned to 3 different string variables ---> (^.*)(_[0-9]+_)(.*$)

Please help.

thanks,
Gershwin
7 years ago
Fred,

More than your answer, I liked the intial part much.. was ROFLing.
thanks for that lighter notation their.

Your regex seems to be an understandably working thing.
Will try it out though.
Thanks man.

Others / Fred even, If you guys have any other suggestion too, please feel free.
Many thanks.

7 years ago
Hi,

I have requirement to split a string based on Regular expression which will be of the below format.

There are 3 different type of String values -

  • ABC_1234_XL.jpg
  • XYZ_7890_SM.jpg
  • PQ_R_4567_LG.jpg


  • in the above ABC, XYZ and PQ_R are 3 types of image types which I want to extract separately and compare it with respective list of corresponding Types fetched from DB.
    So in case if I go with normal split by underscore "_", then it flunks the purpose while splitting the 3rd string.

    So I need a solution to split these string based on Regular expression, where every time the center element will [0-9] and the left would be Image Type and the right would be Image Size.
    Meaning - ImageType_ImageTypeID_ImageSize. We need to split this having the center element (imageTypeID) as base and get the left & right date by excluding the "_".
    How to achieve this with Split along with Regex?

    Help please and let me know in case if you need more info.
    7 years ago
    Ryan,

    My question/problem is how to set the file list to the Bean "userImage".
    I see the file list (multiple as you can see) is not getting set on to the bean.

    Can you guide me for this piece?

    Thanks,
    Gershwin
    8 years ago
    JSP
    Hello there,

    @Bear - Thank you very much for adding the Code tags. I will make sure I do this going forward. Cheers :)

    @Ryan - Yes. I made sure the same name is applied for the form bean as well. Showing you below is the bean details.



    Kindly let me know if you have any more details needed or you want to see the filedrag.js? I can show that too.
    Let me know and thank you very much for pitching in here. :)

    8 years ago
    JSP
    Hey Ranchers,

    I am working on a piece of a code which would help me to - drag multiple files from local window and drop it into a DIV in my application.
    And then I want to bind the file into Struts which is where I am having issues right now, I would like to show you the snippet below with which you can kindly help me,



    Is it an issue when I give the inputType name as userImage?
    Where am I doing wrong, Kindly help me with your inputs or guide me with some good pointers as I have come across almost 1000 sites with respect to this scenario and none was helpful.
    Please respond.

    Many thanks.

    8 years ago
    JSP
    Hello Ranchers,

    I need a help in finding a replacement for the current drag & drop of images upload (single or multiple) functionality that we are using in our application.
    The application is based on Java - Hibernate where currently we use jumpuploaded.jar to do this job.

    Due to some licencing issues, we want to write the drag and drop functionality in jQuery, but most of the cases online I see the pointers for another plugin or some solution based on PHP or HTML5.
    Since the users of this application are using browsers lower than HTML5-supported browers I couldn't invoke those solutions.

    Can you please suggest me pointers or give me an exact insight on how to go about with this?
    Just in case if you want to know about jumploader, here is the link -

    http://jumploader.com/

    Awaiting you answers and questions if any.
    Thanks in advance.

    Ulf Dittmer wrote:You would use a content-disposition of "inline" instead of "attachment", but what happens then is still dependent on the browser and the user's settings. It might be displayed (if a plugin is available that can do this), or it might still be saved if the user prefers that.



    Thank You Dittmer.
    I did try this "inline" option already but still it does use the filename concept.
    right?


    Is there a way where we can use the generation of the excel file to be shown directly on the browser.
    Please help.
    8 years ago
    JSP
    Hello Ranchers,

    Its been a while. Hope everyone and everything is good at your end.
    I am currently looking for a best option to show the content of a workbook or an excel in browser on the fly of generating the workbook.
    Currently, I am able to save the content as an xlsx file which is actually taking space in the temp folder while creation. This becomes an overhead for the user to delete the temp files manually.

    So I am thinking of bringing the content of the generated excel file on the screen and give an option in the screen to download that into file.
    In detail - currently,

    ServletActionContext.getResponse().setContentType("application/vnd.ms-excel");
    ServletActionContext.getResponse().addHeader("content-disposition",
    "attachment; filename=" + filename);


    Instead of creating a file, I want to the excel items to be shown on the screen on the fly.
    Let me know if my question needs more clarity.

    Thanks,
    Gersh
    8 years ago
    JSP
    Thanks a lot Christophe. It worked. Thanks again Rancher.
    11 years ago
    Hi Ranchers,

    I'm trying to fetch a column from DB in my java code but getting the below error.

    org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.Exception
    org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:583)
    org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:501)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

    root cause

    java.lang.Exception
    com.avon.gi.repsuite.ctrl.OnlineOrderDetailsController.handleRequest(OnlineOrderDetailsController.java:552)
    org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
    org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875)
    org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:809)
    org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
    org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:501)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)



    The column name is ORD_MGMT_IP_DT and it is of Date format for example in my case it is 3/12/2010 9:27:11 PM in the db.
    I need to fetch the date time and the AM/PM in the format dd/MM/yyyy hh:mm:ss a
    I tried fetching it by writing it as to_char(rep_ord_trkg.ord_mgmt_ip_dt,'dd/MM/yyyy hh:mm:ss a') AS OrderDate in Java.


    But am not getting the values on the page instead, I'm getting an Error 500 on page. When i tried without the 'a' i.e for the AM/PM i got the value in the page but the time was incorrect, like 12/3/2010 9:03:11. I'm quite confused that, how this is failing to fetch me the correct values when given with 'a' and it is throwing exceptions when given with 'a'.

    Kindly help me out on this ranchers. Thanks a ton in advance.Awaiting your replies.
    11 years ago