Auto log in from applet to web app.
I'm trying to allow a user to jump from an applet to a web app.
The applet code I'm pretty sure is complete. It creates a URL and then calls container().getAppletContext().showDocument(new URL(path),name);
This opens a browser and seems to be sending the correct URL.
What I have done is send it to a URL like /appName/JumpFromApplet
Then I have created a filter in the web app to catch anything of that format.
The doFilter method is being executed and it the if statement is catching it appropriately.
But when the browser opens up the url is just http://localhost:9080/ with a page cannot be found. I'm not sure what I'm doing wrong. Here is the appropriate code. Am I way off base?
private static final String LOGGEDIN_URL = "login.do";
//inside doFilter method
Object o = httpRequest.getSession().getAttribute("LOGGEDIN");
if(o == null && url != null
&& url.indexOf(JUMP) > 0) {
config.getServletContext().getRequestDispatcher(LOGGEDIN_URL).forward(request, response);
}else {
chain.doFilter(request, response);
}edit:
This is basically the same code as in my LoginFilter, I just changed the URL and of course the if statement.
Edited by: gmachamer on Jan 22, 2008 9:05 AM
hmmm, strange. I added the code to the loginFilter as an else if.
If I enter the url in the browser that the filter is suppose to be catching then it works just fine.
If I jump from the applet it does not... but when stepping through the code in both instances it looks like everything is the same?
the else if is what is executed.
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException, ServletException {
HttpServletRequest httpRequest = (HttpServletRequest) request;
Object o = httpRequest.getSession().getAttribute("LOGGEDIN");
String url = httpRequest.getRequestURL().toString();
if (o != null
|| (url != null && (url.indexOf(LOGIN_URL) > 0
|| url.indexOf(LOGIN_FORM_URL) > 0
|| url.indexOf(EXTERNAL_LOGIN_URL) > 0
|| url.indexOf(EXTERNAL_LOGIN_FORM_URL) > 0
|| url.indexOf("images") > 0 || url.indexOf(services) > 0))) {
chain.doFilter(request, response);
return;
}else if(o == null && url != null
&& url.indexOf(JUMP) > 0) {
config.getServletContext().getRequestDispatcher("/" + JUMP_URL).forward(request, response);
return;
config.getServletContext().getRequestDispatcher("/" + LOGIN_FORM_URL)
.forward(request, response);
}Edited by: gmachamer on Jan 22, 2008 9:43 AM
Similar Messages
-
Auto log out from xbox :S in lumia 1520
Auto log out from Xbox account in my 1520 every time I restart the mob and join any game .. Need your Xbox
Website I do use remember me and nothing happens . That is happens with all websites I use
A.A
Solved!
Go to Solution.hi mate, have you checked you are up to date with latest firmware and all latest Nokia system app updates from the Store? also try performing a soft reset and double checking that everything is ok with your Microsoft account online.
-
I have an Access 2013 Web App in my Sharepoint 2013 online website. It contains a query to report on its data (several, actually, but let's keep it simple). I want to connect an Excel spreadsheet to the query, visualise the data in pivot tables/graphs/whatever,
save the spreadsheet in a Document Library, and let other team site Sharepoint users open the spreadsheet (preferably in Excel online, but with Excel client if it has to be) and see/copy the data, refreshed with the latest information from the Access Web App.
Simple, surely!
The way I'm doing it at the moment is to create an ODC file to connect to the cloud-based Access 2013 database, save that ODC in a Data Connection Library in the SP site, and use the saved ODC file as data source in the Excel spreadsheet. This works and
successfully keeps everything 'in the cloud' but I can't get it to refresh in Excel Online, and if I open the spreadsheet in Excel Client I have to enter the database password every time to refresh it. I don't really want to issue this password to everyone
who might want to view the data. There must be a better way than this ODC method, I suspect.
Googlings on this have led down various blind alleys - Excel Services, PowerPivots, Web Parts - but I'm stuck on which to follow through. Please, someone, point me to an article/book/website that explains how to do this step-by-step in simple language..
thanks
JonathanI don't see any quick way of achieving it - at least there's no such functionality exists in SharePoint. All you can do, develop an event receiver that will update the fields in the list item once the excel file is added/updated. You can use OpenXml API
to manipulate the excel file.
Thanks,
Sohel Rana
http://ranaictiu-technicalblog.blogspot.com -
I have just upgraded to Firefox 8.0.1 on may MacBook (10.6.8) and now all files I download from my Outlook Web app labeled attachment.ashx, not as they were originally sent (.docx, .pdf, etc). How do I change this back?
I'm going to back up to Firefox 7 next. I'm getting the drift that 8.0.1 and/or flash on 8.0.1 are unstable.
I'll let you know if that solves this problem.
NOPE. This had no effect. -
How can I create an auto-incrementing ID field for a web app?
I have a web app for a project database. Customers can login and add a new record to the web app. We need it to provide each new project with a unique and sequential number. The BC ID number for each web app item is unique but of course not sequential (and too long). So for example the client would like all project IDs to be 4 digits starting from 1000. Any ideas?
Thanks in advance!Kapowaz,
Just thinking out loud, I wonder if you could use an Automator action to find the last invoice created and open a new file with a name based on incrementing a part of last file's filename. This would make the filename the same as the invoice number and you would still have to transfer the file's name to the content of the file.
If I had this need, I think I would create an Invoice Log document. It would be easy to have a table into which you would enter identifying data and date and have the table generate a new invoice number that you could paste into the current invoice document. It would kill two birds with one stone if you need an index of your invoices.
Jerry -
Communication between applet and Web app (IE6 works IE7 doesn't)
I'm not 100% sure this is the correct forum to post this in, but as the communication is initiated from the applet I'm posting it here.
I have an applet that we are slowly breaking pieces out of into a web app.
The details are as follows.
The applet calls a servlet on the webserver with the following code.
URL url = new URL("http://.................");
ServletMessage message = new ServletMessage(url);
InputStream returnStream = message.sendPostMessage(sending);The servlet takes the user credentials and other info that was sent and authenticates the user and stores the info that was passed into the session on the web server. Then based on the users permissions and where they want to go in the web app the servlets redirect method calls
resp.getOutputStream().print("/AppName/appropriateServlet");This sends control back to the applet (including the url of the servlet that needs to be called) which then calls the appropriate servlet
container.getAppletContext().showDocument(new URL("http://.............." + returnURL), "Title");Now the problem is that in the first and second servlet the request.getSession() returns two different sessions when running under IE7. IE6 returns reference to the same session.
I don't know what has changed in IE7 but I was hoping somebody else has run into this, or can suggest a more appropriate forum to post this to?
ThanksSo the solution I came up with was when the applet jumps to the web app the first time instead of storing everything in session I store them in a map in the servletContext under their employee number.
I then send control back to the applet with the url they should call. When the applet calls the web app for the second time it includes their employee number as parameter in the url.
A Login filter then first checks to make sure it isn't on the first call, and checks to make sure they aren't in session... if so it pulls the map out of servletContext and transfers all the data back to the session and clears that user out of servletContext.
So it stores the user in the servletContext during the transfer back and forth, then back in session like normal.
I'm pretty sure it is going to work, but I can't test it because our mainframe test region is down which is what handles the authentication of the applet. -
i find that i am suddenly logged out of program or an app or website, and i am back to the HOME screen. i have to log back in and sometimes i find back exactly where i left off, some stuff i have entered or written, or sometimes i have to start all over again and re-enter data or write back what i seem to have lost.
i tried a different browser and it does not solve the problem. i tried different apps, website and programs and it happens anywhere and at any app, program or website.
apple staff suggested a complete restore of the IOS software, which is quite an involved process. does anyone know of any possible causes and a simpler
solution without having to reset the entire IOS 7.0.6Hello Philly,
I believe that when you reset your ipod(command given from the computer, right?) touch WHILE the ipod was updating, It cleared the system in the middle of writing files, thus corrupting(equivalent of cutting of in the middle of a sentence) the basic running system.
I suggest you go to an apple store and ask for a technical diagonosis in person. they may offer to help if the problem is fixable. If your ipod is still under warrenty, i would guess it would be free/low cost.
~Remember, I am just giving an educated guess on limited information -
Hi MSDN Forum,
I have created an Access Web App that I am hoping to add some functionality to. I am looking to provide email notification to different users from my organization (a field within the Access Table) when the current date approaches the renewal date (another
field within the Access Table). I would also like to display all renewal dates on a SharePoint Calendar for users to see. Any advice on how to do this would be much appreciated.
Thanks!I'm not familiar with how Access Web Apps work. However, on the SharePoint side of things, it looks like a workflow will be your best bet. Are you using Visual Studio? I've created a few tutorials on sending email notifications in Visual Studio 2012. https://youtu.be/JFdiQEyDkEk
-
Add a link from image in web app
I need to add a link to social media site in a static image in a web app detail layout.
I have thought this would be...
<a href="{tag_facebook}"><img alt="" src="/_assets/css/images/social-facebook.png" /></a>
but this displays the link bedside the icon.
I have tried field type "Text string (Hyperlink)" and "Text string (String)".
any help appreciated.
thanks meganHey Liam,
Franchise list of stores added to a web app abd each store can have a different link added to the icon.
The icon is hard coded into the layout
The url needs to change for each
e.g. 15 Stores, some have their own Facebook page, some will link to a central Facebook page.
So the icon is static in the web app detail layout, but url changes.
When I add the code
<a href="{tag_facebook}"><img alt="" src="/_assets/css/images/social-facebook.png" />
the result in browser looks like...
thanks Liam -
Including output in a JSP page from a separate Web App
I seem to be having a bit of a problem including the output from a sevlet invoked
from a separate
Web Application in the same domain. I have a servlet callsed 'WebApp2\Web-inf\classes\packagename\targetServlet'.
I am attempting to invoke 'targetServlet' from 'WebApp1\somepage.jsp' using the
jsp:include directive but I seem
to be having a path problem because the servlet is not invoked. Anyone have any
suggestions?
Mark:
You cannot do that with <jsp:include>. You can read the JSP spec to learn more
about it.
Anyway, there are some tags out there that do allow what you need. I, for one,
use Struts' <bean:include> tag. See http://jakarta.apache.org/struts/
The new JSTL (JSP Standard Tag Library - http://jakarta.apache.org/taglibs/doc/standard-doc/intro.html)
provides the <c:import> tag.
Greetings
"Mark Andersen" <[email protected]> wrote:
>
>I seem to be having a bit of a problem including the output from a sevlet
>invoked
>from a separate
>Web Application in the same domain. I have a servlet callsed 'WebApp2\Web-inf\classes\packagename\targetServlet'.
>I am attempting to invoke 'targetServlet' from 'WebApp1\somepage.jsp'
>using the
>jsp:include directive but I seem
>to be having a path problem because the servlet is not invoked. Anyone
>have any
>suggestions?
-
Forwarding from servlet in web app...
I'm having a problem forwarding to a page within a web application. Basically if I do:
getServletContext().getRequestDispatcher("/login.htm").forward(request,response);
then the page isn't found as the forward doesn't put the web application context into the URL. I can work round this by using:
request.getContextPath()
and then building up the path with the web application in it.
This becomes a real pain too with static HTML pages. If the pages have links in them which are absolute, again the web application context is not prefixed.
Am I missing something here? I was under the impression that the deployment of web applications was supposed to be transparant to the components within them.
Any help would be appreciated. I'm running on WLS 6 on W2K.
Cheers,
Andy
Andy,
I'm haivng the same problem! I'm working with getting Jive (the open-source
discussion board product) to work with WLS. This software is full of
response.sendRedirect calls that are relative. These all fail with WLS 6.
Jeff Mathers
"Andy Winskill" <[email protected]> wrote in message
news:[email protected]...
>
> I should follow the flow of my servlet better.....
>
> The main problem is with request.sendRedirect not working with a relative
URL. Forwarding to an absolute URL in a web app works fine. However,
absolute links in a HTML page are absolute with respect to the server and
not the web application.
>
> Cheers,
> Andy
>
> "Andy Winskill" <[email protected]> wrote:
> >
> >I'm having a problem forwarding to a page within a web application.
Basically if I do:
> >
>
>getServletContext().getRequestDispatcher("/login.htm").forward(request,resp
onse);
> >
> >then the page isn't found as the forward doesn't put the web application
context into the URL. I can work round this by using:
> >
> >request.getContextPath()
> >
> >and then building up the path with the web application in it.
> >
> >This becomes a real pain too with static HTML pages. If the pages have
links in them which are absolute, again the web application context is not
prefixed.
> >
> >Am I missing something here? I was under the impression that the
deployment of web applications was supposed to be transparant to the
components within them.
> >
> >Any help would be appreciated. I'm running on WLS 6 on W2K.
> >
> >Cheers,
> >Andy
>
-
Cannot open file in Onenote client from within OneNote Web App
I am facing a peculiar problem with One note.
Environment: - SP2013 Enterprise with separate Office Web Apps server
I can view/edit onenote files on OneNote web app without any issue but when I click "Open in OneNote" button, I get the error that "onenote cannot open the specified location..."
Other office documents like word and excel work fine, only onenote has this issue.
Any help is much appreciatedThank you for the update.
We may try to use the Network Monitor tool to capture the network traffic for bothe problematic site and working site when reproducing this issue, and then read the traffic to find out the differences between them. To capture the traffic, start capturing
first, then click the “Open in OneNote” button.
Download Microsoft Network Monitor tool:
http://www.microsoft.com/en-us/download/details.aspx?id=4865
If you cannot find the differences, you can send the capture files to us via
[email protected]
and we will analyse them for you.
Regards,
Steve Fan
Forum Support
Come back and mark the replies as answers if they help and unmark them if they provide no help.
If you have any feedback on our support, please click
here -
How to refer to JNDI PROVIDER_URL from within Tomcat Web app
Can anyone provide a clear description on how to refer to a "Provider_URL" relative to the web application root for which a Java Class resides within? My issue is as follows. I've looked through the JNDI tutorial and the Tomcat JNDI How-To's and I'm still unable to find a solution.
I'll elaborate:
I have a "PROVIDER_URL" class variable defined as:
private String PROVIDER_URL = "file:/C:/development/MyProject/MyWebApplication/WEB-INF/properties";I initialize my JNDI context within the class:
Properties properties = new Properties();
properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.fscontext.RefFSContextFactory");
properties.setProperty(Context.PROVIDER_URL, PROVIDER_URL);
context = new InitialContext(properties);
cpds = (ConnectionPoolDataSource) context.lookup(baseName);
...The above example works fine. My question is given my web app's directory, how do I refer to "MyWebApplication/WEB-INF/properties" in a relative manner so that if I move my web application to a different server, the directory path does not affect my deployment and I dont have to hardcode the current path? Does this need to occur in the "server.xml" file? Can you provide a URL to an example?
Your suggestions are appreciated...thanks.try to give
http://localhost:8080
or the app server based port address. -
Logging with log4j in a Web app that uses TopLink
The deployment engineer in my company is reporting problems with our first Web app that uses both log4j and TopLink. Apparently TopLink is failing to initialize correctly when log4j-1.2.8.jar is deployed to the WEB-INF/classes directory within the Web app.
I know that 9iAS's Enterprise Manager uses an older version of log4j and I wonder if TopLink uses an older version too.
Are there any known problems when using log4j 1.2.8 with TopLink 9.0.3?
Thanks,
Al MargheimUnfortunately, when I asked the deployment engineer for more information on the problem, he couldn't provide any, and since he moved the log4j library out of the application's WEB-INF\classes directory he can't reproduce the problem (whatever it was).
Based on a variety of factors (including your response) I suspect that the people who encountered the problem misinterpreted the cause.
If I can get him to put the log4j library back in WEB-INF\classes and get more specific information about the problem, and it still looks like a conflict between TopLink and log4j, I'll post the errors here.
Thanks,
Al Margheim -
Send data from applet to web server
Hi,
I want to send data(event notification) to resource through web server using url.
Like,As long as perticular action or event is occuring I am sending that message to url.
I reffered Sevlet theory uses HTTPMessage,but I am confused how should start and what would be feasible?
Even when I run my code I am not finding browser.How should I place an applet in web server page?
Regards,
Palak
Message was edited by:
palak_shahHi
I agree usage of HttpClient is a better and a simple method.
But If your Application Requirements are Simple you may go by using URL & URLconnection Objects in java.net package.
Just to Add In You Can Checkout the links given below to have a better understanding of how the communication works...
The Example APPLET code:
http://mindy.cs.bham.ac.uk/AppletServletExample/EgApplet.java.txt
The Example SERVLET code:
http://mindy.cs.bham.ac.uk/AppletServletExample/EgServlet.java.txt
and the Example AppletDemo Class
http://mindy.cs.bham.ac.uk/AppletServletExample/EgApplet.class
Hope this helps :)
REGARDS,
RaHuL
Maybe you are looking for
-
If I create a new Apple ID and I delete the old one, Will I lose my purchases and data?
If I create a new Apple ID and I delete the old one, my books, songs, docs and all the data that my old Apple ID contained including my purchased Apps will appear in my new Apple ID and its associated Icloud? I want to create a new Apple ID but do no
-
I created a 23 minute slideshow with music of family vacation. Youtube and smugmug both said it was too large to post for my family. suggetions please?? I use to use Mobileme...
-
HT1386 i have ipad one with iOs 5.1.1 and i cant update for higher iOs please advice
please advice me how to update my ipad from iOs 5.1.1 to higher iOs as i cant do through itunes and through my ipad itself
-
Hi, I am new to workflow. Please help me in solving this issue. There is a workflow which gets initiated when PR is created.(Business object BUS2105) A mail will be set to the approver when PR is created and a reminder mail will be sent after some du
-
Any danger changing a podcast name?
Hi, I want to be sure that changing my podcast' name in the xml will not affect the old subscribers (Will they still recieve the new episodes automatically?) Or is there any other problems that can be due to a podcast name change? Thanks, Jean.