Desktop application "internal urls" [closed] - java

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
For web applications internal navigation, you usually use URLs, with an URL router/dispatcher.
Is there some equivalent pattern/analogy within a desktop app being really navigation intensive/with multiple views?
Let's say I'm in myapp://view1/subview1?state=someState and I then switch in myapp://view2/subview2/, by deconstructing it in the main controller, which decodes the first part, switches the view to view2, then calls the view2 controller with "/subview2", which itself loads "subview2", etc.
I find it to be a really KISS (keep it simple stupid) abstraction for handling "navigation" state.
Would this "pattern" be practical or an awful idea?
What would be the general plan to implement it in Java? (use URIs? URLs? Strings?)

Application Controller pattern might be a good place to start.

Related

server to client push notification? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I need a solution for a specific feature of my application ,feature is same as recent achievements category of stack overflow.When a specific event happen in server (may be some level achievement or some kind of condition satisfy)then i want to notify to user through the GUI of my application ,What is the best approach to do this specif use case .thanks in adnvance
You'll either want to use WebSockets or clientside polling.
There's a few java libraries out there to help abstract you from the underlying mechanics which can fallback to polling if websockets are not supported by the browser:
cometd
atmosphere
DWR's reverse-ajax
spring mvc
Im sure there's more but that'll get you started :)

Is there any other pattern other than MVP and MVC? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
MVP and MVC are mostly used patterns in Java and other languages. Is there any other list of patterns working like MVC and MVP?
Well I cant speak for Java but with big iOS projects (often using Core Data) you normally expand the MVC pattern to MVCS (Model-View-Controller-Store). The Store is responsible for fetching data provided by external sources and providing data to controllers. You do this to not mess up your controllers in such projects.
But for normal projects MVC is your way to go.

How to write a web browser in java [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I am an amateur java program developer and was wondering if anybody knows how to write a web browser in java if possible.
If you need a component to render HTML, JEditorPane in the javax.swing library is capable of doing it for basic HTML. You could mock browser behavior by adding an input for entering a URL, getting markup, and setting it to the editor pane. Tracking URL history and that sort of thing would be up to you, and it could be a decent project for learning a lot about Swing, event handling, concurrency, etc...
If you're looking at building your own rendering engine for HTML, CSS, and JavaScript... that's a much larger problem.
http://docs.oracle.com/javase/7/docs/api/javax/swing/JEditorPane.html

How to implement login-specific behaviour throughout an application? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I have an web application that should only differ in one point: if a user is logged in, the data should automatically be saved to a DB.
Non-logged in users should be able to use the full application, but without persistence.
How could one implement this best through the whole application?
Would I have to call some Session.getUser.isLoggedIn() before every action that could potentially trigger a persistence action? That's what I came up so far.
Or are there better ways?
Having to write such behavior in single place would be the best approach.
That can be accomplished in variety of ways and depends on what is your technology stack.
Whats your front end? whats your persistence framework?
Lets say you are calling a Stateless session bean for persistence. you can put an interceptor before that, which would check for logged in user before proceeding.

Access website without browser [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I am just learning java. I just want to make a simple application to access a web-site.
there is a website onto which i want to log-in through java:
and then interact with it through my interface, basically after log in, i would be writing in some text boxes and sending it.
I tried many places to do it, studied HTTP protocol but still cant make it.
can someone help me out?
Accessing a web site, logging in and interacting with forms on it is somewhat complex work, so it might not be the best choice for a first java project.
But if you want to do it, you should probably use Apache HttpComponents/HttpClient.
There are useful examples at the above link as well, which may help you get started.

Categories