It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I have a simple portlet application on websphere portal server. On the UI (jsp), there is a text area where user enters some french text and then the portlet gets it and updates to DB.
I enter the French characters by copying from an excel sheet(not through keyboard). But when I save it, the French characters are converted to garabge and saved to DB.
What are some things I should check? This happens only in one environment. In another environment, things run fine. (i.e.French characters are proper)
EDIT: Thank you for the answers. I checked that the data is sent correctly from the browser. Also when I deploy the portlet front end locally and use the back end for SIT, it works fine. But when both the portlet and the back end are SIT, it gives the problem.
You need to make sure that data is sent properly from the browser. For that you can use Firbug to inspect the POST data.
Once you make sure that the information is sent properly,you need to verify how the data on server side.
Assume that you are getting the data from the client in processAction() method. Verify that data from the request is in the correct format. You may have to set the encoding in the ActionRequest as UTF-8. Once you have the data in the correct format you need to verify the encoding which is used in Database.
Related
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
Can we programmatically determine the components of a website by crawling its content?
I understand that this seems kind-of impossible but i think anything is possible in code. I am trying brainstorm ideas based on which i could determine the individual components of a website if i have crawled all of its data!
I am interested in determining components such as , for example , in case of a ecommerce website, i would want to determine or identify:
1. Login Url
2. Registration Url
3. Dashboard url
4. Add order url
5. Shopping cart url
6. Logout Url
and more
The information we might have can be:
1. Session, Cookies, Metadata,
2. Backlinks (internal and external)
3. Forms in a page, fields in a page etc
Any ideas or pointers will be greatly helpful.
You can get the raw HTML results by crawling the domain. And to your URL getting question: Yes, you can determine login, register etc. URL's according to URL and the HTML elements by a system, which can be designed with some experiments.
Worked on crawling gifts' pictures, price etc. from online-shops, it was doable. We gave relativeness points; for example for price, if a text includes "price" it gets 2 points, if it includes "$" or "€" it gets 3 points etc. I try to say you need to do experiments on the data.
You can get forms, Javascript lines etc. as I know, and can experiment on those too.
I recommend using Crawler4j if you'll work with java. Apache Nutch is good too, you can get information about "saving raw html with Nutch" from my questions in my profile, but it's a very big project and I don't think it's worth dealing with all that stuff, for your situation.
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
What's the minimal length for storing a Facebook API Access token in SQL Server?
With the way and frequency Facebook likes to break things for developers, the SQL server equivalent of nvarchar(max) is the only safe way.
I guess you want store it in a mysql database.
use 255 varchar field length of database table
you can also check fb full blog post here https://developers.facebook.com/blog/post/572
EDIT
As the question has changed. I'd suggest you nvarchar(400). This is really too much, but genrally acceptable. As a database developer you always must keep in mind that there can be unpredicted unicode, even when you are absolutely sure that the incoming length will be very small and there will only be English letters.
P.S. domain names always deemed to be only English letters, untill now.
http://путин.рф is an example. This is a working domain.
Source: http://en.wikipedia.org/wiki/.%D1%80%D1%84
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
These days I'm aware of the powerful web browser. In order to know what happend behind the screen. I want to write a simple web browser. But When I try to find document about that. Nothing find! Any one konw how to write a simple web browser or know where is the book will be useful. Please tell me !
Thank you very much!
Start off with a simple browser -- e.g., look at existing text only ones like lynx or w3m. Once you've got them cracked, then you can work up to adding graphical elements. It can get complicated fairly quickly, so make sure you've read the appropriate RFCs for HTTP and the W3C standards as well. These aren't light reading material though :-)
Here's something to get you started:
https://developer.mozilla.org/en/Download_Mozilla_Source_Code
C might not be the best language for this job.
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I am facing a problem while saving a .csv file from browser.
I made a file myfile.csv and added rows into it from my database, and i asked the users to right click and save the page. But in many browser (because some browsers want to add the .txt properties to it) it is getting saved as myfile.csv.txt format.
Most people wouldn’t know to delete the .txt part from the file name so can this be adjusted to always be a .csv format?
can i add a directive to the .htaccess to recognize .csv files? Not sure though.
Please let me know what you think how this can be done.
Any help/idea would be appreciated.
Thanks in advance.
Could be a MIME type issue. Browsers sometimes have the habit of inconsistently using either the file name (extension) or MIME type, but ignoring the other. Since different browsers handle it differently you should make sure they match if you want it handled properly.
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I need to create a windows service that will monitor a directory for newly uploaded files.
The files will be around 100K to 400K in size.
Is there a chance that my monitoring system will notice a new file, but the file hasn't completetly finished copying over? i.e. it is still streaming in and the EOF hasn't been written yet?
Yes, there is a chance that this will happen. You should upload the file to a temporary directory first, then move it to the directory you're monitoring when the entire file is present on your file system.
Try reading the second tale here and the comments. Essentially, it's as Bill the Lizard said
yes. With small files the risk is fairly low, but if you want to be certain have it check when it sees a file to make sure it's size stays stable over a second or two.
Are you using a FileSystemWatcher? I've only used this once, but I think you can configure the parameters to tell it what events you want to consider and set up separate handlers for each. I suspect that the FileSystemWatcher may not even notify you on file creation until the file has been closed, but I haven't tried it.
Note: this is .NET solution. If you're not using .NET, please disregard.