Skip to main content

Hosting a JMaki page

15 replies [Last post]
adelukman
Offline
Joined: 2008-01-06
Points: 0

Hello everybody i have a jmaki application that i am about hosting .Most examples on netbeans.org require that u use Glassfish V2 is it possible for me to deploy on an apache server or can u give me list of Application server that i can host on.
Thanks in advance.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
adelukman
Offline
Joined: 2008-01-06
Points: 0

Thanks sloan,
This is the gist with reference to the widget i have below ,let say tab3 contains login.jsp and login.jsp has a login module that has a pure button(not jmaki widget) which submits the data, after which the response is sent to the same tab3 what do u think i should do . this is my own idea below

value="{ items :[
{label: 'My Tab', content : 'Some Content', id: 'tab1'},
{label: 'My Tab 2', content : '', action:{topic: '/mytopic2', message : { value : 'data.jsp'}} },
[b] {label: 'My Tab 3', include: 'login.jsp', selected: true, id :'tab3', action:{topic: '/mytopic/setInclude', message : { 'targetId':'tab3', value : 'response.jsp'}} }[/b]
]
}" />

the reason why i am putting the action an label "MyTab3" is bcos that is where the event would be generated with topic my topic and me specifying targetid to be "tab3" is bcos i think it should be the consumer of the topic but i am not too sure where to place the subscribe function but just correct me if i am wrong (learning JMAKI after watching Greg on sun site and reading some many articles)

if u can suggest where i can get a good ebook online i wouldn't mind .please correct the syntax if find any error (U have really helped with questions)

sloanb
Offline
Joined: 2003-09-14
Points: 0

Looking at your current widget definition the following would happen. You would click on the accordian menu item id 'tab3' and it would publish to the same widget and include the response.jsp page. I'm not sure if this is what you are actually wanted or not due to the fact that you said you want a log in page. If you are wanting to the log in page to change the contents of tab 3 I would create a listener in your glue.js and have it subscribe to an event on the login.jsp page. Possibly a button click. At that point that payload would then publish to the accordian which would include the response page you are looking for on tab3.

As far as a jMaki book there is not one currently. There has been talk of one but currently there is not one. We will make sure to let everyone know if this changes in the near future. Currently the best thing to do is post on the forums or visit us in the IRC channel.

adelukman
Offline
Joined: 2008-01-06
Points: 0

Thanks for the idea
could u give please give code snippets for the second idea u raised may be i can catch up from there?
it would be well appreciated

sloanb
Offline
Joined: 2003-09-14
Points: 0

Here is an example of a dummy form that pretends to submit and then changes the contents of the dojo.dijit.accordian menu.

Widget

[code]
value="{'rows' :
[{'label':'Login','include': jmaki.webRoot + '/faces/login.jsp'},
{'label':'Magazines','content':'Magazines here'},
{'label':'Newspaper','content':'Newspaper content'}]}" />
[/code]

Glue

[code]
jmaki.subscribe("/dojo/dijit/button/onClick", function(args){
// Your login call here

// Publish to the widget
jmaki.publish("/mydojo/accordian/setInclude", { message : {targetId : 'accordianMenu_tab_0', value : jmaki.webRoot + "/loginResults.jsp" } })
});
[/code]

Login Form

[code]



JSP Page




















[/code]

Results Page

[code]



JSP Page


Login Results


[/code]

This is all using the standard publish/subscribe mechanism. You could also use actions on the button.

adelukman
Offline
Joined: 2008-01-06
Points: 0

I am very greatful for the help Thank u.u are 2 much!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

sloanb
Offline
Joined: 2003-09-14
Points: 0

Always glad to help supporters. Let us know if you have any other questions.

Regards,
--SB

mtv134
Offline
Joined: 2005-04-25
Points: 0

This website has very good resources about java technology
http://www.thejavacode.com/

adelukman
Offline
Joined: 2008-01-06
Points: 0

Sloab tanks for the response but hope it would .becos i tried using the Tomcat on my system but i was getting an error message of reqeust not valid if i can remember .but still want to ask another hosting site with woodstock component will it function very well too on an apache server.

sloanb
Offline
Joined: 2003-09-14
Points: 0

Have you tried any of the example applications to see if they would run properly? If you were getting a invalid request 404 error my guess is that your tomcat container was not setup properly or the application was not deployed. As long as the site you are using as a hosting provider gives you PHP or JSP/Servlet services you should be just fine. Let me know.

--Sloan

adelukman
Offline
Joined: 2008-01-06
Points: 0

Thank u i was hoping if u could help write out the steps to configure my apache server to give a good output using netbeans 6.5 beta

Please could u just give ur own understanding about the publish and subscriber mechanism a real life scenario i would really appreciate it.

sloanb
Offline
Joined: 2003-09-14
Points: 0

If you are running apache tomcat servlet engine you can simply add this server in netbeans by going to the servers tab and selecting add new server. You should be able to find the documentation for that at the netbeans site (http://www.netbeans.org).

The next thing you need to do is make sure you download the latest version of the jMaki plugin for Netbeans 6.5B. You will be able to do this from the Tools->Plugins section of your netbeans IDE. Once you get that installed you will have the ability to create a new project using the jMaki plugin templates.

Creating a jMaki project with netbeans is very easy. You simply need to follow the steps outlined below.

1. From the menu select File->New Project
2. From the Choose Project dialog select Web Application
3. Name your project and sets it path location
4. Next you need to select your deployment server. Use the Apache tomcat server instance you setup in the prior steps here or add a new server for use.
5. You will now see a selection of Frameworks. You need to select jMaki Ajax Framework. Select the CSS layout (No CSS style if you are doing this yourself)
6. Click the Finish button to create your new web project using the jMaki Framework.

After your project has been setup you will be able to drag widgets from the palette on the right (default setup) to the JSP pages for use. In order to configure the widget you can click on the widget in the source and click the jMaki button located at the top of the editor to change its default params.

The publish/subscribe mechanism is how you perform widget to widget communication. In the real world this could be used an endless amount of ways. An easy example would be to click a yahoo.button widget and publish to a jmaki.dcontainer telling it to load a new page in that container. How you use publish subscribe is left up to the developer. There are several good documents and blogs regarding this subject. Below are some links to these resources.

* https://ajax.dev.java.net/publishsubscribe.html
* http://weblogs.java.net/blog/carlavmott/archive/2007/07/jmaki_widgets_t....
* http://weblogs.java.net/blog/gmurray71/archive/2007/07/jmaki_actions_1.html

Let me know if you have any more questions.

--SB

adelukman
Offline
Joined: 2008-01-06
Points: 0

Thanks once a again
got another problem now it is about a site i am building i have a jmaki.dojodijit.accordion widget in it i am placing my jsp files so that somebody gets to see what he want to see by just clicking but in one of them i have jsp page that submit username and password after that i want the response to come back to that same space .how can i achieve that?

sloanb
Offline
Joined: 2003-09-14
Points: 0

When you say jsp files do you mean you are placing the jsp files as includes inside the accordion? If this is the case you can define that entry as an iframe. You would do that simply by adding the iframe : true in the model of the widget. An example

[code]

[/code]

If you notice on 'My Tab' iframe is defined as true. Anything you submit will stay within that frame. Let me know if this is what you are looking for. Another method would be to post using jmaki.doAjax and change the contents of that DContainer based on the results. This could be accomplished in the glue.js. Hope this helps.

--Sloan

adelukman
Offline
Joined: 2008-01-06
Points: 0

The real message is below

sloanb
Offline
Joined: 2003-09-14
Points: 0

You can host any jmaki application on any servlet container such as Apache tomcat.You are not limited to the Glassfish application servr. jMaki will also run on php under apache (httpd) or other web servers that support php.

You can view the basic jMaki application structure by clicking this link: https://ajax.dev.java.net/jmaki-app.html. Let me know if you have any additional questions.