• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

How do I map a htm page to a URL

 
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I want to change jforum so when a user visits the site or after login they are taken to a welcome screen. I also want the user to be taken to a goodbye screen when they log out.

I have changed urlPattern.properties and the redirects in userAction.java so the URL in the browser is correct but this still shows the forum list.

How do I change it so it shows forum_welcome.htm at login and forum_goodbye.htm at logout?

Is it to do with this.context.put() and moduleAction??

Thanks,

Liam
[originally posted on jforum.net by liam]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can use



or, if you're using the latest cvs head / 2.1.5,



Rafael
[originally posted on jforum.net by Rafael Steil]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your reply.

If I use



and add



in urlMappings.properties

where do i specify that /forums/welcome maps to forums_welcome.htm?

How does it know which page to display?

Ideally I would prefer it if forum_welcome.htm and forum_goodbye.htm were included in forum_base.htm to retain the header and footer of the site.

Thanks
[originally posted on jforum.net by liam]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, if you want to use /forums/welcome.page, then you should create a method "welcome" in the ForumAction class, and class this.setTemplateName() to specify the template name to use.

Tempates are defined in the file templatesMapping.properties and related using the class TemplateKeys.java

Rafael
[originally posted on jforum.net by Rafael Steil]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Can i not simply redirect back to


after login and logout and set the context to



Won't this then include the welcome and goodbye screens after the login/logout action is complete?

Liam


[originally posted on jforum.net by liam]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you're using version 2.1.4, then yes.

Rafael
[originally posted on jforum.net by Rafael Steil]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm using 2.1.4 but that didn't seem to work earlier - i will have another look and get back to you - thanks.
[originally posted on jforum.net by liam]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Still having problems.

To make life easier can we just look at logout for now.

I edited the logout method in UserAction.java and added the 2nd line below



I also printed out the moduleAction value in forum_base.htm to help me debug.

The moduleAction remains forum_list.htm even when logout is selected.

I don't know why



isn't being passed back - any idea?
[originally posted on jforum.net by liam]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you use setRedirect, then does not make sense setting moduleAction.

Now, I don't remember much of the code of 2.1.4, since I changed it a lot already - but make sure that there isn't any method / code, after you call this.context.put("moduleAction".. ) that may be changing the value.

Rafael
[originally posted on jforum.net by Rafael Steil]
 
I think she's lovely. It's this tiny ad that called her crazy:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic