Setting image in session
Hi,
Is there any possible way to set photos into session using struts action in servlet and retrieve using struts in jsp??
pls tell me a way for struts 1x...
Thanks in advance
Edited by: bravery on Mar 18, 2010 2:19 PM
Ok. So first of all You have to store images in a special folder or in database. Storing them in special folder is easier at the begining but probably later You'll change it to database. Then, when user logs in You put am image_id attribute in session. To get session object use request.getSession() method, to save attribute in session use session.setAttribute() method. It'll be similar to:
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) {
HttpServletRequestWrapper request = new HttpServletRequestWrapper(req);
// validate user
HttpSession session = request.getSession();
session.setAttribute("image_id", "image id for the user");
}Then write a servlet that will return an image (in bytes) for specified id. Here is an example. Then in your jsp code just put an img tag with src attribute pointing to your image servlet.
<img src="/image_servlet?image_id=${sessionScope.image_id}/>
{code}
That's all in general.
Similar Messages
-
When closing Firefox, after reopening it, my tabs are gone, even though I have Firefox set to remember session. However, after several hours and opening and closings of Firefox, it will open tabs from the old session, for no apparent reason.
You can check for problems with the sessionstore.js and sessionstore.bak files in the Firefox profile folder that store session data.
Delete the sessionstore.js file and possible sessionstore-##.js files with a number and sessionstore.bak in the Firefox profile folder.
*Help > Troubleshooting Information > Profile Directory: Show Folder (Linux: Open Directory; Mac: Show in Finder)
*http://kb.mozillazine.org/Profile_folder_-_Firefox
*http://kb.mozillazine.org/Multiple_profile_files_created
Deleting sessionstore.js will cause App Tabs and Tab Groups and open and closed (undo) tabs to get lost and you will have to recreate them (make a note or bookmark them if possible).
In case you are using "Clear history when Firefox closes":
*do not clear the Browsing History
*Tools > Options > Privacy > Firefox will: "Use custom settings for history": [X] "Clear history when Firefox closes" > Settings
*https://support.mozilla.org/kb/Clear+Recent+History
Note that clearing "Site Preferences" clears all exceptions for cookies, images, pop-up windows, software installation, and passwords. -
<i>I am using NAS 4.1 and was wondering is it possible to set a different session timeout for different users?</i>
Um, there is no such thing as NAS4.1.
I'm assuming that you mean NAS4.0 (maybe NAS4.0sp1?). If so, then the session timeouts are specified in the session section of the NTV configuration files.
AFAIK, you can specify session timeouts on a per user basis. -
How to set image source path in formsweb.cfg file in forms 11g
Hi,
I had written HTML code in the formsweb.cfg file in forms 11g. In the below code i am unable to retrive image file(i.e., .gif, .jpeg) from the server or local machine.
In the below HTML code i set image source in the image tag as below:
<img src="E:\Oracle\Middleware\Oracle_FRHome1\tools\web\html\agilis-life-new11_04.GIF"
Is this correct path to fetch the images from the server or local machine .
Please help me out how to set path for image in html or is there any alternate process to retrive images.
Here is the code :
[INDIVIDUALUAT]
workingDirectory=D:\Aims10dev\Work
form=LMstartup.fmx
userid=rmenu/rmenu@RLIFEQA64
codebase=/forms/java
imageBase=codebase
width=1005
height=750
WebUtilArchive=/forms/java/frmwebutil.jar,/forms/webutil/jacob.jar
WebUtilLogging=off
WebUtilLoggingDetail=normal
WebUtilErrorMode=Alert
WebUtilDispatchMonitorInterval=5
WebUtilTrustInternal=true
WebUtilMaxTransferSize=16384
baseHTMLjinitiator=webutiljini.htm
baseHTMLjpi=webutiljpi.htm
archive_jini=frmall_jinit.jar,life-icons-round.jar,Agilis_Icon.jar,life_Icon.jar,personalize.jar,hyperlink.jar,amazingbutton.jar
archive=frmall.jar
separateFrame=False
lookandfeel=Generic
EndUserMonitoringURL=True
usesdi=yes
#HTMLbeforeForm= <table width="1005" border="0" cellspacing="0" cellpadding="0"><tr><td width="200"><img src="/forms/html/agilis-life-logo.gif" width="200" height="80" /></td><td width="10"><img src="/forms/html/agilis-life-new11_02.gif" width="36" height="80" /></td><td width="805" valign="top" background="/forms/html/agilis-life-new11_03.gif"></td></tr></td></tr></table>
HTMLbeforeForm=<body topmargin="0" leftmargin="0" > <table width="1005" height="100" border="0" cellspacing="0" cellpadding="0"><tr><td width="200" valign="bottom" ><img src="E:\Oracle\Middleware\Oracle_FRHome1\tools\web\html\agilis-life-logo.gif" width="200" height="80" /></td><td width="10" valign="bottom" ><img src="E:\Oracle\Middleware\Oracle_FRHome1\tools\web\html\agilis-life-new11_02.gif" width="36" height="80" /></td><td width="550" valign="bottom" ><img src="E:\Oracle\Middleware\Oracle_FRHome1\tools\web\html\agilis-life-new11_03.gif" width="550" height="80" /></td><td valign="bottom"><table width="219" height="90" border="0" cellspacing="0" cellpadding="0"><tr><td height="36" valign="bottom" align="center"><img src="E:\Oracle\Middleware\Oracle_FRHome1\tools\web\html\agile-logo.jpg" height="36"></td></tr><tr><td height="10" valign="bottom"> <div align="right"><span style="font-family:Arial, Helvetica, sans-serif; font-size:12px; font-weight:bold; text-decoration:none; color:#00000; " >Home | Change Password | Logout</span></div></td></tr><tr><td colspan="3" valign="bottom"><img src="E:\Oracle\Middleware\Oracle_FRHome1\tools\web\html\agilis-life-new11_04.GIF" width="100%" height="39" /></td></tr></table></td></tr></td></tr></table></body>AFAIK, this is not the correct way to set the image location.
We call the working directory as context, so inside the context root along with WEB-INF, maintain a folder with name img and put all the images in that directory.
You can use either .\<image_folder> or the optimum way would be (if you are using JSPs) to use getContext() method and traverse accordingly.
FYI,,, using getContext() will give you context root directory, from there it is as simple as accessing any other folder.
Hope this answers your question.
Cheers,
Jeets. -
How to Set Image to Lock Screen and Background in Windows Store API?
How to set an image to windows lock screen and desktop background for windows store app in c#?
if changing lock screen is available in windows store C# how about changing the desktop background using Windows store C#?Hi icce cage,
To change the Windows lock screen we can use this API:
LockScreen class with set image methods.
To change the desktop background, it is not possible as I know.
--James
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
I read images which are 300 DPI . I get it in BufferedReader, and do some pixel manipulation. When I save those pics as PNG or JPEG the image DPI becomes 72 DPI. There should be a way to set image DPI when converting from Bufferedeader to .pgn or .jpg file.
I need to know how to set DPI to 400 without destroying the image data or pixel height and width. I know of two places within the header of a jpeg that this can be set a third I can see through debug information in metadata but cannot set. Why is this so difficult to manipulate?
-
Code to set and destroy session variables in Java Server Pages(JSP)
code to set and destroy session variables in Java Server Pages(JSP)
we have use following statement to set session variable
session.setAttribute("userClient",id);
we have use following statement to destroy session variable
session.setAttribute("userClient","");
and
the session.invalidate() is not working
Plz. solve this probemcode to set and destroy session variables in Java
Server Pages(JSP)
we have use following statement to set session
variable
session.setAttribute("userClient",id);
we have use following statement to destroy session
variable
session.setAttribute("userClient","");Perhaps if you tried using
session.setAttribute("userClient", null);
or
session.removeAttribute("userClient");
and
the session.invalidate() is not workingNot working how?
>
Plz. solve this probem -
How set image size open raw file?
How to set image size/resolution when opening a raw file in pse 11 editor??
win 7 pro; pse 11 settings: edit>preferences>print resolution = 337.596, screen resolution 109 dpi( 27 inch, dell U 2711). Originally print resoltuion was set to 240 dpi but was changed in case this was causeing a problem. CRAW v 7.4.0.137
Camera alpha 65, image size is: 6000x3376 dpi; (83.33x46.88 inch)
Problem is: Currently when I edit a RAW file in CRAW and then open in pse editor image size is: 6000x3376 px; 25x14.667 inches at 240 dpi ( by ration this corresponds to:17.773x10 inch at 337.6 dpi)
I am trying to change settings so the raw file opens as: 17.776x10 and anywhere from240 to 337.6 dpi
whatever works or is esiest to set.
My settings are for use in creating blue ray dvd movies and with cropping and editing printing high quality pictures for family.
Thanks in advance for any help you can provide.That's a Sony Alpha SLT-A65?
Are those pixel dimensions of 6000 x 3376 the size the camera raw files came out of the camera?
You can't really change the resolution that the photoshop elements version of camera raw opens the the files into the pse 11 at.
(i think 240 is the default for most cameras)
You can however set the resolution with Image>Resize>Image Size if you need to for printing or other uses.
In the Image size dialog uncheck Resample Image and enter the resolution. -
How to set a new session variable?
Hi all,
Can anybody say how to set a new session variable in istore?Hi,
you can use either
pageContext.getAttribute(VAR, PageContext.REQUEST_SCOPE);
or
<%@page session="true" %>
session.putValue
session.getValue
Hope this will help.
Thanks
Gurjeet -
How to set image properties ?
Dear All,
I need your help to set image properties like (Title , Subject , Comments .... )
thanksNVidia writes the DDS file format plugin, you need to talk to them about it.
-
How to set Image to ListView?
How to set Image to ListView?
There is an example about customizing the content of a list view using the cell factory: http://docs.oracle.com/javafx/2/ui_controls/list-view.htm#CEGGEDBF
-
Is it possible to change the automatically set image on the new iMovie Theater title screen?
I made a few movies on the new iMovies 2013 then uploaded into iTheater. I love the software and its ease of use. However, I noticed iTheater automatically sets the title image. Similar to youtube, iTheater probably uses the video mid point image as default. Is it possible to change the set image on iTheater?
Unfortunately, no.
-
Set image colour settings for multiple images
In my workflow I place (Adobe)RGB images into InDesign. PDF export takes care of the RGB to CMYK conversion (convert to destination with preserve numbers).
However this uses the default rendering intent for every conversion: relative colorimetric.
For images, i want to use perceptual.
Is there a way to quickly select all images and change the rendering intent?
All the images have the same ojbect style. Unfortunately i could not find a way to couple the rendering intent to the object style.You can do it it via Assign Profiles...
It can also be scripted, something like this AppleScript:
tell application "Adobe InDesign CS6"
tell active document
set imgs to all graphics
repeat with x from 1 to count imgs
if class of item x of imgs is image then
try
set image rendering intent of item x of imgs to perceptual
end try
end if
end repeat
end tell
end tell -
Hi,
How to setup a session variable of User id in PHP in
Dreamweaver Style. Is it possible to assign the session variable
value equal to user id from the recordset......if yes i need the
procedure. Thanks in advance.prashi123 wrote:
> How to setup a session variable of User id in PHP in
Dreamweaver Style. Is it
> possible to assign the session variable value equal to
user id from the
> recordset......if yes i need the procedure.
There is no "Dreamweaver style" for setting up a session
variable. You
do it in exactly the same way as for any PHP page. Put this
at the
beginning of the page:
session_start();
Retrieve the value that you want from the recordset and
assign it to a
session variable like this:
$_SESSION['user_id'] = $row_recordsetName['user_id'];
David Powers
Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
http://foundationphp.com/ -
How to set image icon to JFrame
Hi all,
how to set image icon in the title bar of JFrame
Thank for your help in advancethanks
I have done as:
Image image;
image=getToolkit().getImage("database_yellow.png");
if(image==null)System.out.println("fault
n("fault image");
this.setIconImage(image);
but when I run my application, I can't see the database_yellow.png in the
title barHm, strange ... from the code snippet you just posted I can't find the error.
This may seem weird, but try to load a small .gif image instead ...
Are you sure the Image is not equal to null?
kind regards,
Jos
Maybe you are looking for
-
What is the best way to archive and store old mail using Apple Mail?
Hi, I have a number of older emails that I would like to archive and store for potential future access. Even though I have mails from earlier Lotus Notes accounts and Microsoft Office accounts, I am referring in this case only to apple mail data that
-
I have a 2006 iMac that I've upgraded to each new os as they came out. I just wiped it (for the kids to use, I have a new iMac with Mavericks) and reintalled Tiger from the original discs. I want to get it back to Lion - which I purchased from the
-
After Add Instance occurs the date/time field data is removed.
I have multiple dropdown options that adds or deletes a row from a table. Trouble is after I have placed a date or time in fields elsewhere on the form, that data is deleted after I make a selection on the dropdown. The dropdown has the options of
-
Do all of Yosemite's new features require Handoff to work?
I have a late 2008 MacBook and I just upgraded to Yosemite and iOS 8 on my iPhone 5s. I read that Handoff doesn't work on MacBook's later than 2012, which wasn't a big deal. I did want to use the messaging SMS and making calls from my MacBook, howeve
-
Where is the MIRO "Note" field contents stored ?
Hi all, I need to print the text stored in the field NOTE of the transaction MIRO. Does anyone know in which tables is it stored ? i'd appreciate your help. Thanks !